第 22 运算符的运算优先级
3129:【例22.1】 有一门课不及格的学生
[例22.1]有一门课不及格的学生
1048:有一门课不及格的学生
1.4_10有一门课不及格的学生(c语言)
1.4_10有一门课不及格的学生(c语言)_哔哩哔哩_bilibili
8108 有一门课不及格的学生
有一门课不及格的学生
1048:有一门课不及格的学生-信息学奥赛一本通
1048:有一门课不及格的学生-信息学奥赛一本通_哔哩哔哩_bilibili
信息学奥赛一本通1048:有一门课不及格的学生
C+1048有一门不及格的学生
赛氪每日一练——有一门课不及格的学生
C源码:
#include <stdio.h>
#include <stdlib.h>
//http://noi.openjudge.cn/ch0104/10/
int main( void )
{
int c,m;
scanf("%d%d",&c,&m);
if((c>=60 && m>=60) || (c<60 && m<60))
{
printf("0");
return 0;
}
printf("1");
return 0;
}
C++程序:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
bool c=0;
cin>>a>>b;
if(a<60)c=!c;
if(b<60)c=!c;
cout<<c;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int ans,num,abc=0;
cin>>ans>>num;
if( ans<60 )
{
abc++;
}
if( num<60 )
{
abc++;
}
if( abc==1 )
{
cout<<1<<endl;
}
else
{
cout<<0<<endl;
}
return 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;
}
python3代码:
"""
1.4编程基础之逻辑表达式与条件分支 10 有一门课不及格的学生
http://noi.openjudge.cn/ch0104/10/
https://blog.csdn.net/yigezzchengxuyuan/article/details/86651658
"""
x, y = map(int, input().split())
if (x < 60 and y > 59) or (x > 59 and y < 60):
print("1")
else:
print("0")
x,y=input().split()
x,y=int(x),int(y)
if x<60 and y>=60 or x>=60 and y<60:
print(1)
else:
print(0)





3020:练5.3 电影票(Scratch、C、C++)
3021:【例6.1】 比赛成绩(Scratch、C、C++、python)
3022:【例6.2】捡石头(Scratch、C、C++、python)
3023:【例6.3】 套盒子(Scratch、C、C++、python)
3024:练6.1 植树造林(Scratch、C、C++、python)
3018:练5.1 复读机(Scratch、C、C++)
3019:练5.2 阿布拉2(Scratch、C、C++)
782

被折叠的 条评论
为什么被折叠?



