UVA 11428 - Cubes

Problem PDF

Solution:

#include
#include
int main()
{
    int n,i,j,k,x,y,f;
    while(scanf("%d",&n)==1)
    {
        if(n==0)
        break;
        k=0;
        f=0;
        x=0;
        y=0;
        for(j=1;jn)
           break;
        }
        if(x==0&&y==0)
        printf("No solution\n");
        else
        printf("%d %d\n",x,y);
    }




    return 0;
}
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/11428/11428.cpp