#include<iostream>#include<cstdio>
using namespace std;intmain(){
for(int i =10; i <=99; i ++){
int a = i/10;int b = i%10;if(a*b+a+b == i) cout << i <<' ';}return0;}
Números naturales interesantes
#include<iostream>#include<cstdio>
using namespace std;intmain(){
for(int i =1000; i <10000; i ++){
int j = i%10*1000+ i/10%10*100+ i/100%10*10+ i/1000;if(i*(i/1000)== j){
cout << i << endl;}}return0;}
Bug trepa por la pared
#include<iostream>#include<cstdio>
using namespace std;intmain(){
int x, y;
cin >> x >> y;int h =0, t =0;while(true){
t ++, h += y;if(h >= x){
cout << t << endl;break;}
t ++, h --;}return0;}
Pollo y conejo en la misma jaula.
#include<iostream>#include<cstdio>
using namespace std;intmain(){
for(int i =1; i <=98; i ++){
for(int j =1; j <=98; j ++){
if(i+j==98&& i*2+j*4==386){
cout << i <<','<< j << endl;}}}return0;}
El problema matemático de Marx
#include<iostream>#include<cstdio>
using namespace std;intmain(){
for(int i =1; i <=30; i ++){
for(int j =1; j <=30; j ++){
for(int k =1; k <=30; k ++){
if(i+j+k==30&& i*3+j*2+k==50){
cout << i <<','<< j <<','<< k << endl;}}}}return0;}