pascal语言程序题

编程让计算机自动出10道三位数以内的加法题,每出一道题作答一次,然后计算机判别该题作答是否正确,正确的显示“right”错的“wrong”

我就写程序中重要的一段好了。
randomize;
for i:=1 to 10 do
begin
a:=random(999);b:=random(999);
c:=a+b;
write(a,'+',b,'=');
readln(n);
while n<>c do begin wrieln('Wrong');readln(n);end; //如果解答错误则继续解答,直到正确为止
writeln('Right');
end;
温馨提示:内容为网友见解,仅供参考
第1个回答  2013-12-31
我写骨干给你
for i:=1 to 10 do
begin
a:=random(1000)+1; b:=random(1000)+1;
s:=a+b;writeln(a,'+',b,'=');
read(n);
if n=s then write('right') else write('wrong');
end;
不懂就追问追问

a:=random(1000)+1; b:=random(1000)+1;
这两个可以输入1000,题目要求喂最大999

相似回答
大家正在搜