Advertisement
egormerk

прогрессия

Apr 13th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3.  
  4. using namespace std;
  5. //слава иисусу христу
  6. int main()
  7. {
  8.     int N, k = 0;
  9.     cin >> N;
  10.     string s[100];
  11.     for (int i = 0; i < N; i++) {
  12.         cin >> s[i];
  13.     }
  14.     int a=0,b=1;
  15.     for (int i = 0; i < N; i++) {
  16.         if(a!=b){
  17.                 if(i+1==N){
  18.                 cout << s[i];
  19.                 a++;
  20.                 }else{
  21.             cout << s[i] << " ";
  22.             a++;
  23.                 }
  24.         }else {
  25.         b++;
  26.         a=0;
  27.         }
  28.  
  29.  
  30.     }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement