当前位置:网站首页>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 学如逆水行舟,不进则退
边栏推荐
- Unity object pool implementation
- Make a boot floppy and boot with bochs emulator
- R language cluster analysis - code analysis
- UnityShader入门精要-基础纹理
- 手机与雷电模拟器里如何使用YiLu代理?
- 什么是代理ip?市面上好用的代理软件有哪些
- Share a professional TA's "Shader Reference"
- 【强化学习】《Easy RL》- Q-learning - CliffWalking(悬崖行走)代码解读
- 强化学习_12_Datawhale深度确定性策略梯度
- 全网可达,交换机和路由器的配置,vlan
猜你喜欢
随机推荐
DRM Memory Management
驱动的参数传入:module_param,module_param_array,module_param_cb
3.事务篇【mysql高级】
Qt信号槽与事件循环的关系
强化学习_06_pytorch-DQN实践(CartPole-v0)
Analysis of minix_super_block.s_ninodes of mkfs.minix.c
Screen post-processing: Sobel operator to achieve edge detection
How to implement a grid construction system
UnityShader入门精要-立方体纹理、反射、折射、菲涅尔反射
修改 QtCreator 配置解决 “无法运行 rc.exe” 问题
vscode + ccls环境配置
MySQL之InnoDB引擎(六)
Analysis of minix_super_block.s_nzones of mkfs.minix.c
虚幻5简单第三人称游戏制作文档
UnityShader入门精要-unity shader基础
Qt程序字体初始化引起的白屏问题
Talking about the realization idea of "frame" of "frame synchronization online game"
老手也常误用!详解 Go channel 内存泄漏问题
Simplest character device driver
请问为什么sqlserver cdc,任务启动过了一天,会报这个错误,明明已经开启cdc了。








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