onp :getting wa help !!

, , ,

getting correct ans on my pc compiler of question link text bt showing wrong ans on codechef . please help …code is in c language


#include<stdio.h>

int main()
{

int n,i,j,top=-1;
char a[400],stack[400];
char temp;
scanf("%d",&n);
for(j=0;j<n && n<100 ;j++)
{
    scanf("%s",&a);

for(i=0;i<strlen(a);i++)
{
    while(a[i]=='(')
    {
        i++;
    }

    if(a[i]=='+' || a[i]=='-' || a[i]=='/' || a[i]=='*' || a[i]=='^')
        {
            temp=a[i];
            ++top;
            stack[top]=temp;

        }
        else
            if(a[i]==')')
        {
            printf("%c",stack[top]);
            --top;

        }
        else
            if((a[i]>=97 && a[i]<=122) || (a[i]>=65 && a[i]<=90))
            printf("%c",a[i]);


        }
        while(top>-1)
        {
            printf("%c",stack[top]);
            --top;
        }

}
return 0;

}

http://www.codechef.com/viewsolution/2695730
this might be helpful…see it…well written c code

cn u please tel me wts the error in my code ??