SHARE
TWEET

Untitled

a guest Sep 18th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top