В следующих задачах допущена ошибка.
Исправьте ошибку. Запишите верное решение задачи в тетрадь и ответ.
Определите, что будет напечатано в результате работы следующей программы.
1) Var s: integer; Begin s := 0; for i := 9 to 13 do s := s + 9; writeln(s); End.
| 2) Var s, i: real; Begin s := 1; for i := 0 to 9 do s := s + 5; write (s); End. | 3) Var s,i: integer; Begin s = 0; for i := 6 to 12 do s := s+10; writeln(s); End. | 4) Var s,i: integer; Begin s := 50; for 0 to 8 do s := s - 4; writeln(s); End. |
5) Var s, k: integer; s := 1; for k := 1 to 7 do s := s*2; write (s); End. | 6) Var s,k: integer; Begin s := 0; for k := 3 to 8 do writeln(s); End. | 7)Var i: integer; Begin s := 1; for k := 0 to 4 do s := s*3; write (s); End.
| 8)Var s,k: integer; Begin s := 0; for k := 4 to 9 do s := s + 12; End. |
9)Var y,i: integer; Begin y := 0; For i := 1 to 3 do y := y + 4*i; Writeln(i); End.
| 10)Var s, n: integer; Begin s := 5; For n := 2 to 4 do s := s + (n/1); Wrnteln(s); End. | 11)Var s, k; Begin s := 2; for k := 1 to 5 do s := s*2; write (s)
| 12)Var s,k: integer; Begin for k:=1 to 11 do s:=s+12; write(s); End. |
13)Var s,k: integer; Begin s := 0; for k := 13 to 16 do s := s + 14; writeln(s); End.
| 14)Var s,k: integer; Begin for k := 12 to 15 do s := 0; s := s + 13; writeln(s); End. | 15)Var s, k: integer; Begin s := 1; for k := 3 downto 0 do s := s*3; write (s); End. | 16)Var c,k: integer; Begin s := 0; for k := 6 to 10 do s := s + 10; writeln(s); End. |
Запишите, что будет напечатано в результате выполнения программы.
1)var s, n: integer; begin s := 42; n := 1; while s 0 do begin s := s – 5; n := n + 3 end; end.
| 2)var n, s: integer; begin n := 1; s := 0; while n begin s := s + 30; n := n * 3 end; end. | 3) var n: integer; begin n := 1; s := 0; while n begin s := s + 30; n := n * 3 end.
| 4)var s, n: integer; s := 301; n := 0; while s 0 do begin s := s - 10; n := n + 2 end; end.
|
5)var s, n: integer; begin s := 78; n := 0; while n do begin s := s – 8; n := n + 2 end; end. | 6)var s, n: integer; begin s := 56; n := 0; while n begin s := s - 6; n := n + 3; end; end. | 7) var n, s; begin n := 1; s := 0; while n begin s := s + 20; n := n * 5 end; end. | 8) var n, s: integer; begin n := 1; s := 0; while n begin s = s + 30; n = n * 5 end; end. |
9) var s, n: integer; begin n := 0; while s begin s := s + 8; n := n + 2 end;
| 10) var n, s: integer; begin s := 0; while n s := s + 7; n := n + 1 end; end.
| 11) begin n := 2; s := 35; while n s := s + 20; n := n + 5 end; write(s) end. | 12) var n, s: integer; begin n := 24; s := 0; while n s := s + 20; n := n + 2 end; write(s) end. |
13) var s: integer; begin n := 3; s := 0; while n s := s + n; n := n + 1 end; end.
| 14) var n, s: integer; begin n := 12; s := 5; while n s := s + 12; n := n + 2 end; write(s) end. | 15) var n, s: integer; begin n := 0; s := 512; s = 0 do begin s := s - 20; n := n + 1 end; write(n) end.
| 16) var n, s: integer; begin n := 4; s := 0; while n begin s := s + 15; n := n + 1; end; write(с) end. |
17) var n, s: integer; begin n := 3; s := 0; while n begin s := s + 6; n := n + 1 end; end. | 18) var n, s; integer; begin n := 4; s := 0; while n begin s := s + 15; n := n + 1 write(s) end. | 19)var n, s: integer; begin n := 4; s := 0; while n begin s := s + 15; n := n + 1 end.
| 20) var n, s: integer; begin n := 0; while n begin s := s + 33; n := n + 1 end; write(s) end. |