当前位置:网站首页>Grammar Basics (Judgment Statements)
Grammar Basics (Judgment Statements)
2022-08-10 06:32:00 【attack siege lion】
作者:进击攻城狮
个人主页:欢迎访问我的主页
首发时间:2022年8月9日星期二
订阅专栏:刷题
个人信条:星光不问赶路人,岁月不负有心人.
如果文章有错误,欢迎在评论区指正.
支持我:点赞+收藏️+留言

文章目录
671. DDD
给定一个整数,Please determine and output the corresponding city name according to the table below:

If the input number is not in the above table,则输出 DDD nao cadastrado.
输入格式
共一行,包含一个整数.
输出格式
The output corresponds to the city name,If there is no corresponding city name,则输出 DDD nao cadastrado.
输入样例:
11
输出样例:
Sao Paulo
#include<iostream>
using namespace std;
int main(){
int a;
cin>>a;
if(a==11)
printf("Sao Paulo");
else
if(a==61)
printf("Brasilia");
else
if(a==71)
printf("Salvador");
else
if(a==21)
printf("Rio de Janeiro");
else
if(a==32)
printf("Juiz de Fora");
else
if(a==19)
printf("Campinas");
else
if(a==27)
printf("Vitoria");
else
if(a==31)
printf("Belo Horizonte");
else
printf("DDD nao cadastrado");
}
662. 点的坐标
给定两个保留一位小数的浮点数 X,YX,Y,用来表示一个点的横纵坐标.
Please judge the position of the point in the coordinate system.

输入格式
共一行,包含两个浮点数 X,YX,Y,表示点的横纵坐标.
输出格式
If the point is in the first quadrant,则输出 Q1,在第二象限,则输出 Q2,以此类推.
If the point is at the origin,则输出 Origem.
否则,如果点在 xx 坐标上,则输出 Eixo X,在 yy 坐标上,则输出 Eixo Y.
数据范围
−10.0≤X,Y≤10.0−10.0≤X,Y≤10.0
输入样例1:
4.5 -2.2
输出样例1:
Q4
输入样例2:
0.0 0.0
输出样例2:
Origem
#include<iostream>
using namespace std;
int main(){
double a,b;
cin>>a>>b;
if(a>0&&b>0)printf("Q1");
else if(a<0&&b>0) printf("Q2");
else if(a==0&&b==0) printf("Origem");
else if(b==0) printf("Eixo X");
else if(a==0)printf("Eixo Y");
else if(a<0&&b<0) printf("Q3");
else printf("Q4");
return 0;
}
666. 三角形类型
读取表示三角形三条边的 33 个浮点数 A,BA,B 和 CC 并按降序排列,使 AA 边是三边中最大的一边.
接下来,According to the following conditions,Determine the types of triangles they can form:
- 如果 A≥B+CA≥B+C,It means that three sides cannot form a triangle,请输出:
NAO FORMA TRIANGULO - 否则,Explain that three sides can form a triangle,Then output as follows:
- 如果A2=B2+C2A2=B2+C2,请输出:
TRIANGULO RETANGULO - 如果A2>B2+C2A2>B2+C2,请输出:
TRIANGULO OBTUSANGULO - 如果A2<B2+C2A2<B2+C2,请输出:
TRIANGULO ACUTANGULO - If all three sides are the same length,请输出:
TRIANGULO EQUILATERO - If only two sides are the same length and the third is different,请输出:
TRIANGULO ISOSCELES
- 如果A2=B2+C2A2=B2+C2,请输出:
输入格式
共一行,包含三个浮点数 A,B,CA,B,C.
输出格式
输出 A,B,CA,B,C The type of triangle that is formed.
注意,More than one of the above conditions may be satisfied,In this case all type names will be used,Output in the order of topic introduction,One output per line.
数据范围
0<A,B,C≤10.00<A,B,C≤10.0
输入样例:
7.0 5.0 7.0
输出样例:
TRIANGULO ACUTANGULO
TRIANGULO ISOSCELES
#include<iostream>
#include<cmath>
using namespace std;
int main(){
double a,b,c;
cin>>a>>b>>c;
if(a<b)swap(a,b);
if(a<c)swap(a,c);
if(b<c)swap(b,c);
if(a>=(b+c))printf("NAO FORMA TRIANGULO\n");
else
if(a*a==(b*b+c*c)) printf("TRIANGULO RETANGULO\n");
else
if(a*a>(b*b+c*c)) printf("TRIANGULO OBTUSANGULO\n");
else
if(a*a<(b*b+c*c)) printf("TRIANGULO ACUTANGULO\n");
if(a==b&&b==c) printf("TRIANGULO EQUILATERO");
else
if(a==b||a==c||b==c)
printf("TRIANGULO ISOSCELES");
}
668. 游戏时间2
读取四个整数 A,B,C,DA,B,C,D,用来表示游戏的开始时间和结束时间.
其中 AA 和 BB 为开始时刻的小时和分钟数,CC 和 DD 为结束时刻的小时和分钟数.
请你计算游戏的持续时间.
比赛最短持续 11 分钟,最长持续 2424 小时.
输入格式
共一行,包含四个整数 A,B,C,DA,B,C,D.
输出格式
输出格式为 O JOGO DUROU X HORA(S) E Y MINUTO(S),表示游戏共持续了 XX 小时 YY 分钟.
数据范围
0≤A,C≤230≤A,C≤23,
0≤B,D≤590≤B,D≤59
输入样例1:
7 8 9 10
输出样例1:
O JOGO DUROU 2 HORA(S) E 2 MINUTO(S)
输入样例2:
7 7 7 7
输出样例2:
O JOGO DUROU 24 HORA(S) E 0 MINUTO(S)
输入样例3:
7 10 8 9
输出样例3:
O JOGO DUROU 0 HORA(S) E 59 MINUTO(S)
#include<iostream>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
if(c>a){
if(d-b<0) printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)",c-1-a,d+60-b);
else
printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)",c-a,d-b);
}
else
if(c<a){
if(d-b<0) printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)",c+24-1-a,d+60-b);
else
printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)",c+24-a,d-b);
}
else
if(a==c&&b==d)
printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)",24,0);
else
if(a==c&&b<d)
printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)",0,d-b);
else
printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)",23,d+60-b);
}
1 学如逆水行舟,不进则退
边栏推荐
- 直接跳转与间接跳转
- Qt使用私有接口绘制窗口阴影
- 强化学习_06_pytorch-DQN实践(CartPole-v0)
- Unity object pool implementation
- 语法基础(判断语句)
- Qt程序字体初始化引起的白屏问题
- ArgumentException: GetComponent requires that the requested component ‘GameObject‘ derives from Mono
- QScroller的QScrollerProperties参数研究
- Share a professional TA's "Shader Reference"
- 全网可达,交换机和路由器的配置,vlan
猜你喜欢
随机推荐
OpenGL学习笔记(LearnOpenGL)-第二部分 绘制三角形
socket实现进程间通信
Lunix(阿里云服务器)安装Anaconda并开启jupyter服务本地访问
关于Qt高频率信号槽合并的误解和方案
UnityShader入门精要-透明效果
Unity的GetComponentsInChildren1、2、3
A*Pathfinding插件(3D)
Talking about 3 common shadow rendering techniques in games (1): plane shadow
全网可达,交换机和路由器的配置,vlan
一种奇怪的函数声明写法
Unity瓦片地图取消部分刚体效果
NetKeeper(创翼)开WIFI方法——2018.5
UnityShader入门精要-unity shader基础
不同场景如何使用动态代理?
【8月9日活动预告】Prometheus峰会
CuteOneP 一款php的OneDrive多网盘挂载程序 带会员 同步等功能
UnityShader入门精要-高级光照基础
手机与雷电模拟器里如何使用YiLu代理?
网页安全证书错误但无法安装证书的解决办法
Teach you to change the kernel source code--sysfs virtual file system 2



![[网络安全]实操AWVS靶场复现CSRF漏洞](/img/7f/f08e429e3d8ede03a1c1754e256f99.png)





