#include<iostream> #include <math.h> using namespace std; int main(){ int a,b,c; while(scanf("%d %d %d", &a, &b, &c)!=EOF){ if(a>b) swap(a,b); if(b>c) swap(b,c); if(a>b) swap(a,b); printf("%d %d %d\n",a,b,c); if(a+b<=c){ printf("No\n"); } else{ if(a*a+b*b==c*c){ printf("Right\n"); } else if (a*a+b*b<c*c){ printf("Obtuse\n"); } else if(a*a+b*b>c*c){ printf("Acute\n"); } } } }
#include #include using namespace std; int main(){ int a,b,c; while(scanf("%d %d %d", &a, &b, &c)!=EOF){ if(a>b) swap(a,b); if(b>c) swap(b,c); if(a>b) swap(a,b); printf("%d %d %d\n",a,b,c); if(a+b<=c){ printf("No\n"); } else{ if(a*a+b*b==c*c){ printf("Right\n"); } else if (a*a+b*bc*c){ printf("Acute\n"); } } } }
可以用swap喔!阿我還改辣麼久