山东理工大学ACM平台题答案关于C语言 1543 Egypt
来源:互联网 发布:php json unicode编码 编辑:程序博客网 时间:2024/05/21 17:04
Egypt
Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^
题目描述
A long time ago, the Egyptians figured out that a triangle with sides of length 3, 4, and 5 had a right angle as its largest angle. You must determine if other triangles have a similar property.
输入
Input represents several test cases, followed by a line containing 0 0 0. Each test case has three positive integers, less than 30,000, denoting the lengths of the sides of a triangle.
输出
For each test case, a line containing "right" if the triangle is a right triangle, and a line containing "wrong" if the triangle is not a right triangle.
示例输入
6 8 1025 52 605 12 130 0 0
示例输出
rightwrongright
#include<stdio.h>
void main()
{
int a,b,c,temp;
while(scanf("%d %d %d",&a,&b,&c),a||b||c)//abc同时wei0的时候结束
{
if(a>b)
{
temp=a;
a=b;
b=temp;
}
if(a>c)
{
temp=a;
a=c;
c=temp;
}
if(b>c)
{
temp=b;
b=c;
c=temp;
}
if(a*a+b*b==c*c)
printf("right\n");
else
printf("wrong\n");
}
}
0 0
- 山东理工大学ACM平台题答案关于C语言 1543 Egypt
- 山东理工大学ACM平台题答案关于C语言 1194 C语言实验——余弦
- 山东理工大学ACM平台题答案关于C语言 1292 图形打印
- 山东理工大学ACM平台题答案关于C语言 1592 转置矩阵
- 山东理工大学ACM平台题答案关于C语言 1229 求奇数的乘积
- 山东理工大学ACM平台题答案关于C语言 1240 多项式求和
- 山东理工大学ACM平台题答案关于C语言 1255 小明A+B
- 山东理工大学ACM平台题答案关于C语言 1601 3n+1数链问题
- 山东理工大学ACM平台题答案关于C语言 1605 Balloon Comes!
- 山东理工大学ACM平台题答案关于C语言 1232 猴子分桃
- 山东理工大学ACM平台题答案关于C语言 1259 Bad Hair Day
- 山东理工大学ACM平台题答案关于C语言 1228 两数组最短距离
- 山东理工大学ACM平台题答案关于C语言 1252 进制转换
- 山东理工大学ACM平台题答案关于C语言 1295 螺旋方阵
- 山东理工大学ACM平台题答案关于C语言 1227 等值数目
- 山东理工大学ACM平台题答案关于C语言 1075 Doubles
- 山东理工大学ACM平台题答案关于C语言 2101 正方形面积
- 山东理工大学ACM平台题答案关于C语言 2098 识别浮点常量问题
- NHibernate
- 随机游走产生图像效果实现
- 赫夫曼树
- Qt学习之如何启动一个线程
- Cordova3.3在android平台下的配置方法
- 山东理工大学ACM平台题答案关于C语言 1543 Egypt
- 4-研究对加速度计的标定
- 两位数乘法的速算方法(一)
- 发布系统后Excel导出失效
- 多路径配置vlome group共享存储,VG的更新。
- 跨类访问窗体控件内容
- DrawText
- Wpf 学习系列2 命令模型
- Spring 运用 pointcut 和 advisor 对特定的方法进行切面编程