#includeusing namespace std;int main() {int n[999]={0},c[999]={0},a,b=0,index;for(int i=0;i<10;i++){cin>>a;if(a==0){break;}else{n[i]=a;b++;}}if(b==2){for(int i=0;iif(n[i]%7==0){index=i;}}}else if(b>2){for(int i=0;iif(n[i]%7==0){c[i]=n[i]%70;}else{c[i]=n[i]%77;}}sort(c,c+b);for(int i=0;iif(n[i]%7==0){if(n[i]%70==c[b-1]){index=i;break;}}else if(n[i]%7!=0){if(n[i]%77==c[0]){index=i;break;}}}}cout<return 0;}
給你一個範例你想想看
9 8 7 0