View Code of Problem 114

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