View Code of Problem 114

#include "stdio.h"
void main(){
    char a[100];
    int j,flag;
    while (gets(a) != EOF){
        for (int i = 0; a[i] != '\0'; ++i) {
            if (a[i] >= 'a' && a[i] <= 'z' || a[i] >= 'A' && a[i] <= 'Z'){
                j = flag = i;
                while (a[++j] != ' '){
                    flag++;
                }
                for (;j >= i; j--) {
                    printf("%c",a[j - 1]);
                }
                i = flag;
            }
        }
    }
}

Double click to view unformatted code.


Back to problem 114