。。
2023-01-15 19:12:24
发布于:浙江
为什么我的代码不对
#include <iostream>
using namespace std;
int main(){
int a,b;
cin >> a >> b;
if(a<60||b<60){
cout << "1";
}else
cout << "0";
return 0;
}
全部评论 9
- 建议您可以去看看我的题解题解 - 2024-07-15 来自 浙江 1
- 题目是“有一门”课不及格的学生,注意是只有一门课不及格,你的判断逻辑没有办法排除两门课都不及格的情况。 - 2023-02-21 来自 浙江 1
- #include<bits/stdc++.h> 
 using namespace std;
 int main()
 {
 int a,b;
 cin>>a>>b;
 if(a<60&&b>=60||b<60&&a>=60)
 {
 cout<<1;
 }
 else{
 cout<<0;
 }
 }- 2025-03-25 来自 浙江 0
- #include<iostream> 
 using namespace std;- int main(){ 
 int a,b;
 cin>>a>>b;
 if(a>=60&&b>=60){
 cout<<"0";
 }else if(a<60&&b<60){
 cout<<"0";
 }else{
 cout<<"1";
 }- return 0;- } 
 这样也可以。- 2024-12-08 来自 浙江 0
- ”else“后面要加“{”;"return0;"和“cout<<"0";”之间要加“}”; - 2024-12-08 来自 浙江 0
- #include <iostream> using namespace std; int main(){ int a,b; cin>>a>>b; if(a<60&&b>=60||a>=60&&b<60){ cout<<"1"; }else{ cout<<"0"; } return 0; }- 2024-10-11 来自 浙江 0
- #include<cstdio> int a,b;int main(){scanf("%d%d",&a,&b);if(a<60&&b>=60||a>=60&&b<60) printf("1");else printf("0");}- 两行代码 - 2024-07-19 来自 浙江 0
- #include <iostream> 
 using namespace std;
 int main(){
 int a,b;
 cin >> a >> b;
 if((a<60&&b>=60)||(a>=60&&b<60))
 {
 cout << "1";
 }
 else
 cout << "0";
 return 0;
 }- 2023-02-21 来自 浙江 0
- else后面没有大括号 - 2023-01-22 来自 陕西 0- 不用加也可以 - 2023-02-18 来自 广东 2
 








有帮助,赞一个