#include<iostream>usingnamespace std;voidsolve(){int a, b, c, d, e, f;int i, j;for(int a =1; a <5; a++){for(int b =0; b <5; b++){for(int c =0; c <5; c++){for(int d =1; d <5; d++){for(int e =0; e <5; e++){for(int f =0; f <5; f++){i = a *100+ b *10+ c;j = d *100+ e *10+ f;if(i %20&& j &&40){if(i /2== j /4){cout <<"雞有"<< i /2<<"只"<<"兔有"<< j /4<<"只"<<"雞腳有"<< i <<"個"<<"兔腳有"<< j <<"個"<< endl;}else{continue;}}}}}}}}}intmain(){solve();return0;}
#include<iostream>usingnamespace std;voidsolve(){int a, b, c;int x;for(a =1; a <=8; a++){for(b =0; b <=7; b++){for(c =2; c <=9; c++){if(a<c && a>b){if(a + b + c != a * b * c){continue;}else{x =100* a +10* b + c;cout <<"三位數是"<< x;}}}}}}intmain(){solve();return0;}
#include<iostream>usingnamespace std;voidsolve(){int x, y;int z;for(int y =1; y <=100; y++){for(z =0; z <=11; z++){if(10* y -2==12*(y -1)- z){x =10* y -2;}}}cout << x;}intmain(){solve();return0;}