Python 3
y = int(input()) #Ввод переменной y
y -= 1 #Уменьшение переменной на 1
print(y) #Вывод переменной y
или
print(y - 1) #Вывод переменной y уменьшенной на 1
C++
#include <iostream>
using namespace std;
int main(){
int y;
cin >> y; #Ввод переменной y
y --; #Уменьшение переменной на 1
cout << y; #Вывод переменной y
return 0;
}
cout << y - 1; #Вывод переменной y уменьшенной на 1
1. program ex1;
uses crt;
var i, count : integer;
begin
count:=0;
for i:=1 to 9999 do
if (i mod 5 = 0) and (i mod 7 = 0) then
writeln(i);
count:=count+1;
if count=10 then
break;
end;
end.
2. program ex2;
var sum, count, n : integer;
n:=9999;
sum:=0;
while not (n = 0) do
readln(n);
if (not n mod 2 = 0) and (n>0) then
sum:=sum+n;
writeln('Ср. арифм. = ', sum/count);
3. program ex1;
var price, i: integer;
write('Введите цену товара за 1 кг. :');
readln(price);
for i:=1 to 15 do
write(i:6, '|');
writeln();
write('');
write((price/10*i):6,'|');
Python 3
y = int(input()) #Ввод переменной y
y -= 1 #Уменьшение переменной на 1
print(y) #Вывод переменной y
или
y = int(input()) #Ввод переменной y
print(y - 1) #Вывод переменной y уменьшенной на 1
C++
#include <iostream>
using namespace std;
int main(){
int y;
cin >> y; #Ввод переменной y
y --; #Уменьшение переменной на 1
cout << y; #Вывод переменной y
return 0;
}
или
#include <iostream>
using namespace std;
int main(){
int y;
cin >> y; #Ввод переменной y
cout << y - 1; #Вывод переменной y уменьшенной на 1
return 0;
}
1. program ex1;
uses crt;
var i, count : integer;
begin
count:=0;
for i:=1 to 9999 do
begin
if (i mod 5 = 0) and (i mod 7 = 0) then
begin
writeln(i);
count:=count+1;
if count=10 then
break;
end;
end;
end.
2. program ex2;
var sum, count, n : integer;
begin
count:=0;
n:=9999;
sum:=0;
while not (n = 0) do
begin
readln(n);
if (not n mod 2 = 0) and (n>0) then
begin
sum:=sum+n;
count:=count+1;
end;
end;
writeln('Ср. арифм. = ', sum/count);
end.
3. program ex1;
var price, i: integer;
begin
write('Введите цену товара за 1 кг. :');
readln(price);
for i:=1 to 15 do
write(i:6, '|');
writeln();
for i:=1 to 15 do
write('');
writeln();
for i:=1 to 15 do
write((price/10*i):6,'|');
end.