山东理工大学ACM平台题答案关于C语言 1543 Egypt

浏览:
字体:
发布时间:2013-12-21 10:32:57
来源:

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
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");

}

}

>更多相关文章
24小时热门资讯
24小时回复排行
资讯 | QQ | 安全 | 编程 | 数据库 | 系统 | 网络 | 考试 | 站长 | 关于东联 | 安全雇佣 | 搞笑视频大全 | 微信学院 | 视频课程 |
关于我们 | 联系我们 | 广告服务 | 免责申明 | 作品发布 | 网站地图 | 官方微博 | 技术培训
Copyright © 2007 - 2024 Vm888.Com. All Rights Reserved
粤公网安备 44060402001498号 粤ICP备19097316号 请遵循相关法律法规
');})();