Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- #include<ctype.h>
- int main() {
- char symbols[100] = {0};
- char result[100] = {0};
- int lenght;
- gets(symbols);
- lenght = (int) strlen(symbols);
- int lenght2 = lenght + lenght/3;
- result[lenght2 --]=0;
- int counter=1;
- for(int i=lenght-1; i>=0; i--)
- {
- result[lenght2--]=symbols[i];
- if(counter % 3 == 0)
- result[lenght2--]=' ';
- counter++;
- }
- printf("%s", result);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement