小代码 算法小题目
#include<stdio.h>intmain(){inte,g,f;inta,b,c;inteh,el,gh,gl,fh,fl;for(a=1;a<10;a++){for(b=1;b<10;b++){if(a==b){continue;}for(c=1;c<10;c++){if(b==c||a==c){continue;}for(e=11;e<100;e++){eh=e/10;el=e%10;if(eh==a||eh==c||el==c||eh==b||el==a||el==b||eh==0||el==0||eh==el){continue;}for(f=11;f<100;f++){fh=f/10;fl=f%10;if(fh==a||fh==c||fl==c||fh==b||fl==a||fl==b||fh==0||fl==0||fh==fl||fh==el||fh==eh||fl==el||fl==eh){continue;}for(g=11;g<100;g++){gh=g/10;gl=g%10;if(gh==a||gh==c||gl==c||gh==b||gl==a||gl==b||gh==0||gl==0||gh==gl||gh==el||gh==eh||gl==el||gl==eh||gh==fl||gh==fh||gl==fh||gl==fl){continue;}//printf("bbbbbbbbbb\n");if(a*f*g+b*e*g==c*e*f){printf("%d%d%d%d%d%d\n",a,b,c,e,f,g);}}}}}}}printf("ccccccccccccccccccc\n");getchar();return0;}
//http://tool.lu//
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。