1.11 150d tu 5,2,1 d

/*In cac cach de co 150d gom 3 loai 5d 2d 1d*/

#include<stdio.h>

#include<conio.h>

int d1,d2,d5,i=0;

main()

{

for(d1=1;d1<=150;d1++)

for(d2=1;d2<=75;d2++)

for(d5=1;d5<=30;d5++)

{

if((d1+d2*3+d5*5)==150)

{

printf("

Co %d to 1d, %d to 2d, va %d to 5d",d1, d2, d5);

i++;

if(i%30==0)

getch();

}

}

printf("

Vay co tat ca %d cach", i);

getch();

}

Bạn đang đọc truyện trên: truyentop.pro

Tags: #education