Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. //#define cin in
  4. //#define cout out
  5. using namespace std;
  6.  
  7. ifstream in("mangsis.txt");
  8. ofstream out("mangval.txt");
  9.  
  10. int main()
  11. {
  12.     //long long n; cin >> n;
  13.  
  14. for(int n=0; n<100; n++){
  15.     long long a=1, b=pow(10, 10), c;
  16.  
  17.     while (b > a) {
  18.         c = (b + a) / 2;
  19.         if (c * (c + 1) / 2 < n) {
  20.             a = c + 1;
  21.         }
  22.         else {
  23.             b = c;
  24.         }
  25.     }
  26.  
  27.  
  28.     if(c%3==0){
  29.         cout << "ryytlid";
  30.     }
  31.     else if(c%3==1){
  32.         cout <<"maagid";
  33.     }
  34.     else{
  35.         cout<<"vibulaskjad";
  36.     }
  37.     cout << endl;
  38. }
  39.  
  40.     return 0;
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement