nicuvlad76

Untitled

Feb 23rd, 2021
461
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. #define N 10000
  3. using namespace std;
  4. ifstream fin("bac.in");
  5. int main()
  6. {
  7.   char s[500]="",cuv[21][21];
  8.   int n,i,k;
  9.   cin>>n; cin.get();
  10.   for(i=1;i<=n;i++)
  11.   {
  12.       cin>>cuv[i];
  13.   }
  14.   cin>>k;
  15.   for(i=1;i<=n;i++)
  16.     if(strlen(cuv[i])==k)
  17.   {
  18.       strcat(s,cuv[i]);
  19.       strcat(s," ");
  20.   }
  21.   for(i=1;i<=n;i++)
  22.     if(strlen(cuv[i])!=k)
  23.   {
  24.       strcat(s,cuv[i]);
  25.       strcat(s," ");
  26.   }
  27.   s[strlen(s)-1]=NULL;
  28.   cout<<s;
  29.   return 0;
  30. }
  31.  
RAW Paste Data