Advertisement
Cucura_Georgiana

Varianta 2019, Subiect 3 (Simulare)

Nov 19th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. (Simulare bacalaureat, martie 2019)
  2.  
  3. 2.  #include<iostream>
  4. #include<cstring>
  5. using namespace std;
  6. char x[501], *p, R[501];
  7. int main()
  8. {
  9.     cin.getline(x, 501);
  10.     p=strtok(x, " ");
  11.     while(p!=0)
  12.     {
  13.         if(p[strlen(p)-1]=='.')
  14.         {
  15.             if(p[0]=='C')
  16.             {
  17.                 strcat(R, "COLEGIUL");
  18.             }
  19.             if(p[0]=='L')
  20.             {
  21.                 strcat(R, "LICEUL");
  22.             }
  23.             if(p[0]=='N')
  24.             {
  25.                 strcat(R, "NATIONAL");
  26.             }
  27.             if(p[0]=='T')
  28.             {
  29.                 strcat(R, "TEORETIC");
  30.             }
  31.         }
  32.         else
  33.         {
  34.             strcat(R, p);
  35.         }
  36.         strcat(R, " ");
  37.         p=strtok(0, " ");
  38.     }
  39.     cout<<R;
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement