Бейсик Python
DIM N, S AS INTEGER
N = 1
S = 0
WHILE N <= 100
S = S + 30
N = N * 2
WEND
PRINT S
n = 1
s = 0
while n <= 100:
s = s + 30
n = n * 2
print(s)
Паскаль Алгоритмический язык
var n, s: integer;
begin
n := 1;
s := 0;
while n <= 100 do
s := s + 30;
n := n * 2
end;
write(s)
end.
алг
нач
цел n, s
n := 1
s := 0
нц пока n <= 100
s := s + 30
кц
вывод s
кон
Си++
#include <iostream>
using namespace std;
int main()
{
int n, s;
n = 1;
s = 0;
while (n <= 100)
s = s + 30;
n = n * 2;
}
cout « s « endl;
Бейсик Python
DIM N, S AS INTEGER
N = 1
S = 0
WHILE N <= 100
S = S + 30
N = N * 2
WEND
PRINT S
n = 1
s = 0
while n <= 100:
s = s + 30
n = n * 2
print(s)
Паскаль Алгоритмический язык
var n, s: integer;
begin
n := 1;
s := 0;
while n <= 100 do
begin
s := s + 30;
n := n * 2
end;
write(s)
end.
алг
нач
цел n, s
n := 1
s := 0
нц пока n <= 100
s := s + 30
n := n * 2
кц
вывод s
кон
Си++
#include <iostream>
using namespace std;
int main()
{
int n, s;
n = 1;
s = 0;
while (n <= 100)
{
s = s + 30;
n = n * 2;
}
cout « s « endl;
}