#B1742. 求成绩.填空题
求成绩.填空题
题目描述
输入一名学生的信息技术成绩若分数 < 60 输出 “N” , 60 <= 分数 < 80 输出 “Y” ,分数 >= 80 输出 “G” 。
输入格式
一行,一个 0 到 100 之间的整数,表示该学生的信息成绩。
输出格式
该学生的成绩等级
样例
80
G
完善程序
- 第一种写法
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t; // t 是要输入的成绩
if( 填空(1) )
cout<<"N";
else if( 填空(2) ) // 能执行这个判断,一定是前面的判断不满足的情况下
cout<<"Y";
填空(3)
cout<<"G";
return 0;
}
填空(1):{{ input(1) }}
填空(2):{{ input(2) }}
填空(3):{{ input(3) }}
- 第二种写法
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t; // t 是要输入的成绩
if( 填空(4) )
cout<<"G";
else if( 填空(5) ) // 能执行这个判断,一定是前面的判断不满足的情况下
cout<<"Y";
else
cout<<"N";
return 0;
}
填空(4):{{ input(4) }}
填空(5):{{ input(5) }}