Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- long long n, i,j, flag;
- while(scanf("%lld",&n)==1)
- {
- if(n==0)
- break;
- flag=0;
- for(i=1;i<60;i++)
- {
- for(j=0;j<=i;j++)
- {
- if(n==(i*i*i-j*j*j))
- {
- flag=1;
- break;
- }
- }
- if(flag==1)
- break;
- }
- if(flag==1)
- {
- printf("%lld %lld\n",i,j);
- }
- else
- {
- printf("No solution\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement