I edited the 1st and 3rd "#include" preprocessors and deleted the 4th and 5th last lines of code (because my printer has no ink). I can execute the program and it doesn't close as soon as I press a button now, which is good. But now it won't let me input any information. Any help would be very much appreciated. Thanks.
Code:
#include <iostream>
#include <conio.h>
#include <cmath>
int main()
{
long n=1,i,j,flag,s,k; //initializing
long p=3; //replace 'p' to check for any other power
while(1) //loop till infinity
{
flag=0;k=pow(n,p);
for(i=1;pow(i,p)<k;i++) //looping first number
{
for(j=i+1;pow(i,p)+pow(j,p)<=k;j++) //looping second number
{
s=pow(i,p)+pow(j,p);
if(s==k){flag++;}
if(flag==2){break;} //break out of loop if found
}
if(flag==2){break;}
}
}
return 0;
}