Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char ch = ' ';
- bool First = 1;
- bool last = 1;
- while (true){
- list *a = ListCreate();
- while (ch == ' ')
- scanf("%c", &ch);
- int len = 0;
- while (ch != ' ' && ch != '.'){
- ++len;
- ListAppend(a, ch);
- scanf("%c", &ch);
- }
- int block = len;
- if (len > 1 && First == 0)
- printf(" ");
- last = !(len > 1);
- First = 0;
- if (len % 2 == 1)
- block = len / 2;
- int cnt = 0;
- for (list_item *it = a->head; it; it = it->next, ++cnt)
- if (cnt != block)
- printf("%c", it->key);
- ListFree(a);
- if (ch == '.'){
- printf(".");
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement