View Code of Problem 114

#include "stdio.h"
void main(){
    char a[100];
    int j,flag;
  while(gets(a)){
  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;
        }
    
    }printf(" ");
  }
}

Double click to view unformatted code.


Back to problem 114