#C01L05P07. C01.L05.if语句及其嵌套.例题4

C01.L05.if语句及其嵌套.例题4

聪聪想把成绩转换成 A(90-100含90),B(80-90含80),C(60-70含60),D(小于60)时,可以用 if 语句嵌套

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int cj;

	cin>>cj;

	if( cj >= 90 ) cout<<"A";
	else if( cj >= 80) cout<<"B";
	else if( cj >= 60) cout<<"C";
	else cout<<"D";

	return 0;
}

试试把上面程序复制到C++里运行并理解程序,分别输入 100,80,70,50 运行结果分别是 {{ input(1) }} , {{ input(2) }} , {{ input(3) }} , {{ input(4) }} 。