Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <iostream>
- int main()
- {
- char str[200];
- printf("Introduceti sirul de charactere: ");
- std::cin.getline(str, 200);
- int l = strlen(str);
- for (int i = l - 1; i >= 0; i--) {
- if (str[i] == ' ') {
- str[i] = '\0';
- printf("%s", &(str[i]) + 1);
- }
- }
- printf("%s", str);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment