Sunday, December 22, 2013

String manipulation

#include <stdio.h>
#include <string.h>
#define MAX 100


int main(){
    int I, J, K;
    char A[MAX][MAX];
    K = 0;
    while(gets(A[K]) != NULL && strcmp(A[K++], "0") != 0);
    K--;
    for(I = 0; I < strlen(A[0]); I++){
        for(J = 0; J < K; J++)
            printf("%c", A[J][I]);
           printf("\n");
    }  
    return 0;
}

No comments:

Post a Comment