Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n, x;
- int main() {
- cin >> n;
- for (int i = 1; i <= n; i++) {
- cin >> x;
- int o = (x + 180) % 360;
- if (!o) o = 360;
- if (x % 10 >= 5) x = x / 10 + 1;
- else x /= 10;
- if (o % 10 >= 5) o = o / 10 + 1;
- else o /= 10;
- x = min(x, o);
- if (x / 10 == 0) cout << "0";
- cout << x << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement