using System;
namespace sessen_三目运算
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("三目运算");
//求出两个数最大的
int a=1, b=2;
int i1 = b > a ? b : a;
//输入的不是帅哥,就是美女
Console.WriteLine(i1);
Console.WriteLine("输入一个名称");
string str = Console.ReadLine() == "帅哥" ? "嗨!帅哥" : "嗨!美女";
Console.WriteLine(str);
// 输入成绩全部大于90分毕业
Console.WriteLine("输入姓名");
Console.ReadLine();
Console.WriteLine("输入C#成绩");
int Csharp = int.Parse(Console.ReadLine()), Unity = int.Parse(Console.ReadLine());
string str1 = Csharp > 90 && Unity > 90 ? "毕业" : "不毕业";
Console.WriteLine(str1);
//判断闰年
Console.WriteLine("输入年份");
int year = int.Parse(Console.ReadLine());
string str2 = year % 4 == 0 || year % 400 == 0 || year % 100 != 0 ? "是闰年" : "不是闰年";
Console.WriteLine(str2);
}
}
}
唐老师的自己私下联系题