int day = 6;
if (day == 6|| day ==7)
{
cout << "周末";
}
else
{
cout << "工作日";
}
int age = 20;
if (age >= 18 && age <= 60)
{
cout << "成年人";
}
else
{
cout << "其他";
}
int score = 55;
if (score >= 60)
{
cout << "及格";
}
else
{
cout << "不及格";
}
int a = 10;
a = 20;
int score = 75;
if (score >= 90)
{
cout << "优秀";
}
if (score >= 80 && score < 90)
{
cout << "良好";
}
if (score >= 60 && score < 80)
{
cout << "及格";
}
if (score < 60)
{
cout << "不及格";
}
int hour = 14;
if (hour < 12)
{
cout << "上午好";
}
if (hour >= 12 && hour < 18)
{
cout << "下午好";
}
if (hour >= 18)
{
cout << "晚上好";
}
int age = 8;
if (age <= 6)
{
cout << "免票";
}
if (age > 6 && age <= 12)
{
cout << "半票";
}
if (age > 12)
{
cout << "全票";
}
int temp = 30;
if (temp >= 35)
{
cout << "炎热";
}
if (temp >= 20 && temp < 35)
{
cout << "舒适";
}
if (temp >= 0 && temp < 20)
{
cout << "寒冷";
}
if (temp < 0)
{
cout << "严寒";
}
int day = 3;
if (day == 6 || day == 7)
{
cout << "周末";
}
if (day >= 1 && day <= 5)
{
cout << "工作日";
}
if (day < 1 || day > 7)
{
cout << "日期错误";
}
16题 | 被引用0次