在我的代码中,我试图创建一个不低于运算符.我做不了a !< b......我该怎么办?我可以使用任何包装/方法吗?
此代码显示1的无限循环,但我不希望它!下面的代码有什么问题?
#include<iostream>
using namespace std;
int main()
{
int i,num1=0,num2=0,num3=0; // declares four variables
for(i=100;i<=500;i++){ // for loop initiated from 100
int j=i; // since value of i gets changed afterwards hence store its current value in a variable
num1=i%10;
i=i/10;
num2=i%10;
num3=j/100;
if(num1*num1*num1 + num2*num2*num2 + num3*num3*num3 == j)
cout<<j<<endl;
// displays the number for above condition matched
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)