LXLS @ 2019-03-01 22:54:26
只得40分,除1,4点都WA了 求大佬能帮忙看下代码,万分感谢大佬们
#include<iostream>
using namespace std;
int a[5],b[5],c[5];
int q,w,e,ppt = 1;
int main()
{
cin >> q >> w >> e;
for(int i = 123;i <= 999; i++)
{
a[1] = i / 100;
a[2] = i / 10 % 10;
a[3] = i % 100 % 10;
b[1] = i / q * w / 100;
b[2] = i / q * w / 10 % 10;
b[3] = i / q * w % 100 % 10;
c[1] = i / q * e / 100;
c[2] = i / q * e / 10 % 10;
c[3] = i / q * e % 100 % 10;
if(a[1] + a[2] + a[3] + b[1] + b[2] + b[3] + c[1] + c[2] + c[3] == 45 && a[1] * a[2] * a[3] * b[1] * b[2] * b[3] * c[1] * c[2] * c[3] == 362880)
{
ppt = 0;
cout << i << " " << i / q * w << " " << i / q * e << endl;
}
}
if(ppt)
{
cout <<"NO!!!" <<endl;
}
return 0;
}
by aminoas @ 2019-03-02 08:46:40
by aminoas @ 2019-03-02 08:47:18
做橙题的大佬