第三节课第二题

1、#让用户输入姓名 语文 数学 英语 三门成绩,然后给用户显示:XX,你的总成绩为XX分,平均成绩为XX分
程序

Console.WriteLine("请输入你的姓名:");
            string str_name = Console.ReadLine();
            Console.WriteLine("请输入你的语文成绩:");
            string str_chinese = Console.ReadLine();
            Console.WriteLine("请输入你的数学成绩:");
            string str_math = Console.ReadLine();
            Console.WriteLine("请输入你的英语成绩:");
            string str_english = Console.ReadLine();
            int chinese = Convert.ToInt32(str_chinese);
            int math = Convert.ToInt32(str_math);
            int english = Convert.ToInt32(str_english);
            int sum = chinese + english + math;
            int avg = sum / 3;
            Console.WriteLine(str_name);
            Console.WriteLine("你的总成绩:{0},平均成绩:{1}", sum, avg);
            Console.ReadKey();

2、#让用户输入天数,并计算这个天数是几周零几天
程序

 Console.WriteLine("请输入天数:");
            string str_day = Console.ReadLine();
            int day = Convert.ToInt32(str_day);
            int week = day / 7;
            int Day = day % 7;
            Console.WriteLine("{0}天是{1}周零{2}天", day, week, Day);
            Console.ReadKey();
```![成绩.jpg](https://upload-images.jianshu.io/upload_images/14498195-b1701d97e78fce7c.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

![天数.jpg](https://upload-images.jianshu.io/upload_images/14498195-65941026945eeac0.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

你可能感兴趣的:(第三节课第二题)