fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. //從小到大印邊長
  5. int a,b,c, temp;
  6. scanf("%d%d%d",&a,&b,&c);
  7. if(a>b){
  8. temp=b;
  9. b=a;
  10. a=temp;
  11. }
  12. if(a>c) {
  13. temp=a;
  14. a=c;
  15. c=temp;
  16. }
  17. if(b>c) {
  18. temp=b;
  19. b=c;
  20. c=temp;
  21. }
  22. printf("%d %d %d\n",a,b,c);
  23.  
  24. //列印三角形種類
  25. if(a+b<=c)
  26. printf("No");
  27. else if(a*a+b*b<c*c)
  28. printf("Obtuse");
  29. else if(a*a+b*b==c*c)
  30. printf("Right");
  31. else if(a*a+b*b>c*c)
  32. printf("Acute");
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0s 5316KB
stdin
10 100 10
stdout
10 10 100
No