Higher Math
来源:互联网 发布:单片机哪种好 编辑:程序博客网 时间:2024/04/26 01:24
求个最大边,然后根据直角三角形两边平方和等于第三边的平方,即可确定这是个直角三角形。
#include<stdio.h>int main(){ int a,b,c,temp,N; int i=1; while(scanf("%d", &N)!=EOF) { while(N--) { scanf("%d %d %d",&a,&b,&c); if(a>b) { if(a>c) ; else { temp = c; c = a; a = temp; } } else { if(b<c) { temp = c; c = a; a = temp; } else { temp = b; b = a; a = temp; } } printf("Scenario #%d:\n", i); i++; if((c*c+b*b) == a*a) printf("yes\n\n"); else printf("no\n\n"); } } return 0;}
囧囧说要多练习,写一个调用函数,使用全局变量的。O(∩_∩)O~~
#include<stdio.h>int a,b,c;void max(){ int temp; if(a>b) { if(a>c) ; else { temp = c; c = a; a = temp; } } else { if(b<c) { temp = c; c = a; a = temp; } else { temp = b; b = a; a = temp; } }}int main(){ int N; int i=1; while(scanf("%d", &N)!=EOF) { while(N--) { scanf("%d %d %d",&a,&b,&c); max(); printf("Scenario #%d:\n", i); i++; if((c*c+b*b) == a*a) printf("yes\n\n"); else printf("no\n\n"); } } return 0;}
- Higher Math
- Higher Math
- Higher Math
- Higher Math
- Higher Math
- Higher Math
- Higher Math
- hdu 2393 Higher Math
- hd 2393 Higher Math
- HDU 2393 Higher Math
- HDU - 2393 Higher Math
- hdu 2393 Higher Math
- HDU1.2.7 Higher Math
- HDU 2393 Higher Math
- HDU 2393 Higher Math
- HDU Higher Math
- ACM-水题 Higher Math
- HDU 2393 Higher Math
- android显示图片小例子
- C/C++网络编程中的TCP保活
- 用递归法将一个字符串逆向输出
- 蓝牙配对失误两则
- 写代码的女汉子
- Higher Math
- 12月3号面试题记录
- fecn-create和fecn-adapt的作用
- 基于visual Studio2013解决C语言竞赛题之0904文件排序
- wikioi 1042 进制转换
- TCP Keepalive 笔记
- SRM 599 DIV2 950
- Problem 56: 某种序列(大数加法+数列)
- Windows下Emacs+ Distel的配置