求助一下

P1618 三连击(升级版)

## @[lizhuorong](/user/719843) ``` #include<bits/stdc++.h> using namespace std; int main() { int a,b,c,n[10],s=1,flag=1; cin>>a>>b>>c; for(int i=1;i<=333;i++) { int m[10]={0}; flag=1; int d=a*i; int e=b*i; int f=c*i; n[0]=d/100; n[1]=d%100/10; n[2]=d%10; n[3]=e/100; n[4]=e%100/10; n[5]=e%10; n[6]=f/100; n[7]=f%100/10; n[8]=f%10; for(int j=0;j<9;j++) { for(int k=1;k<=9;k++) { if(n[j]==k) { m[k]++; } } } for(int j=1;j<=9;j++) { if(m[j]!=1) { flag=0; } } if(flag==1) { cout<<d<<' '<<e<<' '<<f<<endl; s=0; } } if(s==1) { cout<<"No!!!"; } return 0; } ```
by shiyueheng @ 2023-11-18 17:03:38


@[shiyueheng](/user/941090) 谢谢
by lizhuorong @ 2023-11-18 17:04:43


100分代码
by shiyueheng @ 2023-11-18 17:05:12


|