Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (Simulare bacalaureat, martie 2019)
- 2. #include<iostream>
- #include<cstring>
- using namespace std;
- char x[501], *p, R[501];
- int main()
- {
- cin.getline(x, 501);
- p=strtok(x, " ");
- while(p!=0)
- {
- if(p[strlen(p)-1]=='.')
- {
- if(p[0]=='C')
- {
- strcat(R, "COLEGIUL");
- }
- if(p[0]=='L')
- {
- strcat(R, "LICEUL");
- }
- if(p[0]=='N')
- {
- strcat(R, "NATIONAL");
- }
- if(p[0]=='T')
- {
- strcat(R, "TEORETIC");
- }
- }
- else
- {
- strcat(R, p);
- }
- strcat(R, " ");
- p=strtok(0, " ");
- }
- cout<<R;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement