第四次作业第三题
2018-10-31 本文已影响0人
孤独是种安全感_b7bf
代码
namespace 第三题
{
class Program
{
static void Main(string[] args)
{
/**
-
1.语文成绩大于90并且音乐成绩大于80, 则奖励100元.
-
2语文成绩等于100并且音乐成绩大于70,则奖励100元.
-
*/
Console.WriteLine("请输入语文成绩:");
int chinese = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入音乐成绩:");
int music = Convert.ToInt32(Console.ReadLine());
bool b = (chinese >= 90 && music >= 80)||(chinese>=100&&music>=70);
if (b)
{
Console.WriteLine("奖励100元。");
}Console.ReadKey(); }
}
}
效果
