Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int n, x;
  6.  
  7. int main() {
  8. cin >> n;
  9. for (int i = 1; i <= n; i++) {
  10. cin >> x;
  11. int o = (x + 180) % 360;
  12. if (!o) o = 360;
  13. if (x % 10 >= 5) x = x / 10 + 1;
  14. else x /= 10;
  15. if (o % 10 >= 5) o = o / 10 + 1;
  16. else o /= 10;
  17. x = min(x, o);
  18. if (x / 10 == 0) cout << "0";
  19. cout << x << endl;
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement