level 5
游戏1.
var x,y,x1,y1:longint;
begin
writeln('Let us play a game!');
randomize;
x:=random(100);
y:=random(100);
writeln('x-y=',x-y);
writeln('x+y=',x+y);
write('x=');
read(x1);
write('y=');
readln(y1);
if ((x1-y1)=(x-y))and((y1+x1)=(x+y)) then
begin
writeln('You are right!');
readln;
end
else
begin
writeln('You are wrong!');
readln;
writeln('x=',x);
writeln('y=',y);
readln;
end;
end.
2014年12月24日 05点12分
1
level 5
游戏2.
program paigame(input,output);
uses crt;
var a,r,score:integer;
b:boolean;
procedure case1;
var ch:shortint;
begin
writeln('----- ----- -----');
writeln('| | | | | |');
writeln('| | | | | |');
writeln('| * | | | | |');
writeln('| | | | | |');
writeln('| | | | | |');
writeln('----- ----- -----');
writeln('Card1 Card2 Card3');
delay(300);
clrscr;
writeln('Which card is ''*''?');
readln(choose);
if choose=1 then begin writeln('Good!Score+10.'); score:=score+10; readln; b:=true; end
else begin writeln('Oops!The right one is Card1!Game over.'); readln; end;
end;
procedure case2;
var ch:shortint;
begin
writeln('----- ----- -----');
writeln('| | | | | |');
writeln('| | | | | |');
writeln('| | | * | | |');
writeln('| | | | | |');
writeln('| | | | | |');
writeln('----- ----- -----');
writeln('Card1 Card2 Card3');
delay(300);
clrscr;
writeln('Which card is ''*''?');
readln(choose);
if choose=1 then begin writeln('Good!Score+10.'); score:=score+10; readln; b:=true; end
else begin writeln('Oops!The right one is Card2!Game over.'); readln; end;
end;
procedure case3;
var ch:shortint;
begin
writeln('----- ----- -----');
writeln('| | | | | |');
writeln('| | | | | |');
writeln('| | | | | * |');
writeln('| | | | | |');
writeln('| | | | | |');
writeln('----- ----- -----');
writeln('Card1 Card2 Card3');
delay(300);
clrscr;
writeln('Which card is ''*''?');
readln(choose);
if choose=1 then begin writeln('Good!Score+10.'); score:=score+10; readln; b:=true; end
else begin writeln('Oops!The right one is Card2!Game over.'); readln; end;
end;
begin
b:=true;
while b=true do
begin
b=false;
writeln('Press Enter key to begin...');
readln;
write('Ready?')
delay(200);
writeln(' Go!');
delay(100);
clrscr;
r:=trunc(random*2)+1;
case r of
1:case1;
2:case2;
3:case3;
end;
end;
writeln('Your score:',score);
writeln('Thanks for playing!Press Enter key to exit.');
readln;
end.
2014年12月24日 05点12分
2
level 5
var n,i,j,k,s:longint;
begin
for i:=1 to 100 do
if i mod 2=1 then
k:=k+100;
writeln(k);
readln;
end.
2014年12月24日 05点12分
5
好东西,袁健聪的屁股真大
![[哈哈]](/static/emoticons/u54c8u54c8.png)
!
2014年12月24日 05点12分
level 1
如果实在答不不出来,那把贪吃蛇1.0.0和1.0.1给我吧!
2014年12月24日 09点12分
9
level 5
var n,i,j,k,s:Longint;
begin
read(n);
for i:=1 to n do
j:=i mod 2;
if j=2 then
k:=k+5;
writeln(k);
end.
2014年12月24日 09点12分
11