C++ 谁能帮忙看一下程序哪里出错了

#include <iostream>using namespace std;int main(){ int x,y,z,a,b,c,d,e,f,g,h,i; for(x=100;x<333;x++){ y=x*2; z=x*3; a=x/100; c=x%10; b=x-a*100-c; d=y/100; f=y%10; e=y-d*100-f; g=z/100; i=z%10; h=z-g*100-i; if((a!=b)&&(a!=c)&&(a!=d)&&(a!=e)&&(a!=f)&&(a!=g)&&(a!=h)&&(a!=i)&&(b!=c)&&(b!=d)&&(b!=e)&&(b!=f)&&(b!=g)&&(b!=h)&&(b!=i)&&(c!=d)&&(c!=e)&&(c!=f)&&(c!=g)&&(c!=h)&&(c!=i)&&(d!=e)&&(d!=f)&&(d!=g)&&(d!=h)&&(d!=i)&&(e!=f)&&(e!=g)&&(e!=h)&&(e!=i)&&(f!=g)&&(f!=h)&&(f!=i)&&(g!=h)&&(g!=i)&&(h!=i)&&(a!=0)&&(b!=0)&&(c!=0)&&(d!=0)&&(e!=0)&&(f!=0)&&(g!=0)&&(h!=0)&&(i!=0)) cout<<x<<" "<<y<<" "<<z<<endl; } return 0;}

b=x-a*100-c; 应该为 b=(x-a*100-c) / 10;
同样 e ,h 的值也要除以10
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜