abc+bcc=532。先来我的ac: 对,就是这么简单
#include<iostream>
using namespace std;
int main()
{
cout<<"3"<<" "<<"2"<<" "<<"1"<<endl;
//cout<<""<<" "<<""<<" "<<"6"<<endl;
return 0;
}
当然也可以按照常规的思路:
#include<iostream> using namespace std; //abc+bcc=532 int main() { int a,b,c; for (a=1;a<=5;a++) for (b=0;b<10;b++) for (c=1;c<=6;c++) if (a*100+b*10+c+b*100+c*10+c==532) cout<<a<<" "<<b<<" "<<c<<endl; return 0; }
原文:http://www.cnblogs.com/jianrenguo/p/6475405.html