-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.txt
57 lines (54 loc) · 1.08 KB
/
test.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
var i,j,k;
procedure test1;
begin
/=* 求1-100所有的质数 */
write(2);
/* 测试for、后置++ */
for(i:=3;i<=100;i++)
begin
k:=0;
/* 测试for、前置++ */
for(j:=2;j*j<=i;++j)
begin
/* 测试取余 */
if i%j=0
then
k:=1;
end;
/* 测试取反 */
if !k=1
then
write(i);
end
end;
procedure test2;
var score;
begin
/* 输出成绩等级 */
read(score);
if score>=90
then
/* 输出字符(ASCII表示) */
writeCh(65);
else
begin
if score >=80
then
writeCh(66);
else
begin
if score>=70
then
writeCh(67);
else
writeCh(68);
end
end
end;
begin
/* 测试if else、writeCh -- 输出成绩等级 */
call test2;
writeCh(10);
/* 测试for、前置后置++、取余、取反 -- 求1-100所有的质数 */
call test1;
end.