Advertisement
Guest User

Untitled

a guest
Nov 9th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void coutResult(int t);
  6. void init(int& a, int& b, int& c);
  7. int result(int a, int b, int c);
  8.  
  9. int main() {
  10. int a, b, c;
  11. init(a, b, c);
  12. int t = result(a, b, c);
  13. coutResult(t);
  14. }
  15.  
  16. void init(int& a, int& b, int& c) {
  17. cin >> a >> b;
  18. c = 180 - (a + b);
  19. }
  20. int result(int a, int b, int c) {
  21. if (a == 90 || b == 90 || c == 90) {
  22. if (a == 45 || b == 45 || c == 45) return 0;
  23. else return 1;
  24. }
  25. if (a > 90 || b > 90 || c > 90) return 2;
  26. return 3;
  27. }
  28.  
  29. void coutResult(int t) {
  30. cout << t;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement