SHARE
TWEET

Varianta 2019, Subiect 3

Cucura_Georgiana Nov 20th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (Sesiunea specială, 29 mai 2019)
  2. (Incercare)
  3.  
  4. 2.  #include<iostream>
  5. #include<cstring>
  6. using namespace std;
  7. char x[1001], *p;
  8. int main()
  9. {
  10.     int i, n, c=0;
  11.     cin>>n;
  12.     cin.get();
  13.     cin.getline(x, 1001);
  14.     p=strtok(x, " ");
  15.     while(p!=0)
  16.     {
  17.         c++;
  18.         if(strlen(p)==n)
  19.         {
  20.             cout<<p<<'\n';
  21.         }
  22.         if(strlen(p)!=n)
  23.         {
  24.             c--;
  25.         }
  26.         p=strtok(0, " ");
  27.     }
  28.     if(c==0)
  29.     {
  30.         cout<<"nu exista";
  31.     }
  32.     return 0;
  33. }
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