功能
用到的觀念
CODE
#include<iostream>//header file
#include<iomanip>
#include<cmath>
using namespace std;
using std::setw;
using std::fixed;
using std::setprecision;
#include<string>
#include<cstdlib>
using std::string;
using std::getline;
using std::srand;
using std::rand;
#include"ctime"
using std::time;
int main()
{
int a,b,c,d,e;
for(int i=100;i<1000;i++)
{
b=i/100;
c=i-b*100;
d=c/10;
e=c-d*10;
if(i==(pow((double)b,3)+pow((double)d,3)+pow((double)e,3)))
cout<<i<<endl;
}
system("pause");
return 0;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.7.59
※ 編輯: jasonfghx 來自: 140.112.7.59 (01/20 20:41)