SHARE
TWEET

Untitled

a guest Feb 19th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. int main()
  3. {
  4.     int N;
  5.     int k;
  6.     std::cin >> N;
  7.     std::cin >> k;
  8.     int* mass = new int[N];
  9.     int count = 0;
  10.     int kol_op = 0;
  11.     for (int i = 0; i < N; i++) {
  12.         mass[i] = 1;
  13.     }
  14.     for (;;) {
  15.         for (int i = 0; i < N; i++) {
  16.             if (mass[i] != 0) count++;
  17.             if (count == 3) {
  18.                 mass[i] = 0;
  19.                 count = 0;
  20.                 kol_op++;
  21.                 for (int j = 0; j < N; j++) {
  22.                     std::cout << mass[j] << ' ';
  23.                 }
  24.                 std::cout << std::endl;
  25.             }
  26.         }
  27.         if (kol_op == N - 1) break;
  28.     }
  29.     for (int i = 0; i < N; i++) {
  30.         if (mass[i] == 1) {
  31.             std::cout << i+1;
  32.             break;
  33.         }
  34.     }
  35.     system("pause");
  36.     return 0;
  37. }
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