SHARE
TWEET

Untitled

a guest Sep 16th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4.     int n;
  5.     cin>>n;
  6.     string arr[n],s1,s2,s3;
  7.     int k=0,t=-1,l,c=0;
  8.     while(getline(cin,s1)&&s1[0]!=0){
  9.             l=s1.size()-3;
  10.         while(1){
  11.  
  12.         if(t==l||c==n){
  13.           arr[k]=s1[0]+s1[1];
  14.             c++;
  15.             break;
  16.         }
  17.         if(arr[k]==0){
  18.             t++;
  19.         }
  20.         k++;
  21.         if(k>n){
  22.             k=0;
  23.         }
  24.         }
  25.  
  26.     }
  27.     for(int i=0;i<n;i++){
  28.         if(i==0){
  29.             cout<<arr[i];
  30.         }
  31.         else{
  32.             cout<<" "<<arr[i];
  33.         }
  34.     }
  35.     cout<<endl;
  36. }
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