http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2474
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11479.htm
#include "stdio.h" int main() { int num,tmp = 1; long long int in[3]; scanf( "%d",&num); while( num-- ) { scanf(" %lld %lld %lld",&in[0],&in[1],&in[2]); if( in[0] + in[1] <= in[2] || in[0] + in[2] <= in[1] || in[1] + in[2] <= in[0] ) printf("Case %d: Invalid\n",tmp); else if( in[0] == in[1] && in[1] == in[2] ) printf("Case %d: Equilateral\n",tmp); else if( in[0] == in[1] || in[1] == in[2] || in[0] == in[2]) printf("Case %d: Isosceles\n",tmp); else printf("Case %d: Scalene\n",tmp); tmp++; } return 0; }
沒有留言:
張貼留言