2
已解决
张梓沫
资深守护
资深守护
#include<iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
int a;
cin>>a;
if(a>=175&&a<=180)
{
cout<<"Yes"<<" ";
if(a>=175&&a<=180)
cout<<"A";
if(a>=181&&a<=185)
cout<<"B";
}
if(a<175||a>185)
cout<<"No";
return 0;
}
1
1
贾子昂
中级守护
中级守护
if(a>=175&&a<=180)
{
cout<<"Yes"<<" ";
这里错了,应该改成:
if(a>=175&&a<=185)
{
cout<<"Yes"<<" ";
因为题目上说身高在175~185之间为“Yes”!
1
0
欧阳语聪
资深守护
资深守护
if(a>=175&&a<=185){ cout<<"Yes "; if(a>=175&&a<=180){ cout<<"A"; } else{ cout<<"B"; } } else{ cout<<"No"; }
0
王光裕
资深光能
资深光能
核心代码: int a; cin>>a; if(a>=175) if(a<=185) if(a<=180) cout<<"Yes"<<" "<<"A"; if(a>=175) if(a<=185) if(a>=181) cout<<"Yes"<<" "<<"B"; if(a<175) cout<<"No"; if(a>185) cout<<"No"; return 0;
完美!
0