Guest User

Untitled

a guest
Feb 15th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main() {
  6. int a, b, c;
  7. int tri=0, sharp=0, obtuse=0, right=0;
  8. while(cin>>a>>b>>c) {
  9. int temp = max({a, b, c});
  10. if(temp==b) {
  11. swap(a, b);
  12. } else if(temp==c) {
  13. swap(a, c);
  14. }
  15. if(a>=b+c) break;
  16. tri++;
  17. int d = b*b+c*c-a*a;
  18. if(d==0) right++;
  19. else if(d>0) sharp++;
  20. else obtuse++;
  21. }
  22. cout << tri << ' ' << right << ' ' << sharp << ' ' << obtuse << '\n';
  23.  
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment