Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main() {
- char s[21];
- char result[21];
- cin.getline(s, 21);
- // s contine Popescu Vasile
- strcpy(result, strrchr(s, ' ')+1);
- result[1] = '\0';
- strcat(result, ". ");
- strcat(result, strtok(s, " "));
- cout << result;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement