using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(4 % 2); //取余 输出为0
Console.WriteLine(5 % 2);
Console.WriteLine("请先输入你的语文成绩");
string strchinese = Console.ReadLine();
Console.WriteLine("请先输入你的数学成绩");
string strmath = Console.ReadLine();
Console.WriteLine("请先输入你的英语成绩");
string strenglish = Console.ReadLine();
int chinese = Convert.ToInt32(strchinese);
int math = Convert.ToInt32(strmath);
int english = Convert.ToInt32(strenglish);
int total = chinese + math + english;
Console.WriteLine("你的总分为{0}", total);
int average = total / 3;
Console.WriteLine("你的平均分为{0}", average);
Console.ReadKey();
}
}
}
网友评论