✌ac!点关注!
2026-08-25 12:59:51
发布于:浙江
0阅读
0回复
0点赞
if-else判断嵌套,头文件只需iostream就行了哦!
推荐复制+粘贴,有问题问我哦❤
#include<iostream>
using namespace std;
int main(){
int n,m,x,a=17,b,c;
cin>>n>>m>>x;
if(x-15<=0)cout<<"late";
else{
x-=15;
b=5+n;
c=10+m;
if(a<=b){
if(a<=c){
if(a<=x)cout<<"on time";
else cout<<"late";
}
else{
if(c<=x)cout<<"on time";
else cout<<"late";
}
}
else{
if(b<=c){
if(b<=x)cout<<"on time";
else cout<<"late";
}
else{
if(c<=x)cout<<"on time";
else cout<<"late";
}
}
}
return 0;
}
这里空空如也






有帮助,赞一个