UVA 11192 - Group Reverse

Problem PDF

Solution:

#include
#include
int main()
{
    char a[100];
    int i,j,n,p,s,l;
    while(scanf("%d",&p)==1)
    {
        if(p==0) break;
        scanf(" ");
        gets(a);
        l=strlen(a);
        n=l/p;
        s=0;j=0;
        while(j=j;i--)
            printf("%c",a[i]);
            j=j+n;
        }
        printf("\n");
    }
    return 0;
}
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/11192/11192.cpp