可能有点麻烦,但百分百过。用这种方法只能把&&后面的也写了。有更简便的,暂不提供。

凌愉晴  •  2个月前


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int x;
	cin>>x;
	if(x>=90) cout<<"A";
	if(x>=80&&x<90) cout<<"B";
	if(x>=70&&x<80) cout<<"C";
	if(x>=60&&x<70) cout<<"D";
	if(x<60) cout<<"E";
	return 0;
}


评论: