Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int main() {
- int a, b, c;
- int tri=0, sharp=0, obtuse=0, right=0;
- while(cin>>a>>b>>c) {
- int temp = max({a, b, c});
- if(temp==b) {
- swap(a, b);
- } else if(temp==c) {
- swap(a, c);
- }
- if(a>=b+c) break;
- tri++;
- int d = b*b+c*c-a*a;
- if(d==0) right++;
- else if(d>0) sharp++;
- else obtuse++;
- }
- cout << tri << ' ' << right << ' ' << sharp << ' ' << obtuse << '\n';
- return 0;
- }
Add Comment
Please, Sign In to add comment