Advertisement
Vlad020924

V95 2009 s2 ex5

Nov 17th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <cstring>
  4. using namespace std;
  5. char c[25],*p,np[20],n[20];
  6. int main()
  7. {
  8.     int i;
  9.     cin.getline(c,25);
  10.     p=strtok(c," ");
  11.     strcpy(n,p);
  12.     p=strtok(0," ");
  13.     strncat(np,p,1);
  14.     strcat(np+1,". ");
  15.     strcat(np+3,n);
  16.     cout<<np;
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement