[r]
(1)Bai 1:
Vua ga vua cho Bo lai cho tron Ba muoi sau Mot tram chan chan
Giai Var x,y:byte;
Begin
For x:=1 to 35 For y:=1 to 35
If (2*x+4*y=100) and x+y=36 then Begin
Writeln(‘so ga la’,x); Writeln(‘so cho la’,y); End;
Readln; End
Bai 2:Tinh x^y voi x,y nguyen duong nhap tu ban phim Giai Var x,y,i:byte; z:longint; Begin Write(‘x,y=,);readln(x,y); Z:=1;
If y=o then writeln(‘z=’,1); Else if y>0 then
Begin
For i:=1 to y z:=z*x; Writeln(x,’mu’,y,’=’,z);
End; Readln; End
Bai 3:Tim cac so co chu so cho tong lap phuong cac chu so =chinh no Giai
Var a,b,c:byte; Begin
For a:=1 to For b:=0 to For c:=1 to
If a*a*a+b*b*b+c*c*c=100*a+10*b+c thenwriteln(a,b,c); Readln;
End
(2)Var i,j:1 100; Begin
For i:=1 to 100 Begin
For j:=1 to i
If i mod j=0 then dem:=dem+1;
If dem:=2 then writeln(‘cac so nguyen to tu den 100 la’,i) End;