1) Первое задание:
var a: integer;
begin
write ('Введите число: ');
readln (a);
if (a mod 2 = 0) then
writeln ('Четное число')
else writeln ('Не четное');
readln;
end.
2) Второе задание:
program test;
var a: integer;
begin
write ('Введите число: ');
readln (a);
if a > 0 then
a:= a + 1;
if a < 0 then
a:= a - 2;
if a = 0 then
a:= 10;
writeln (a);
end.
Word Pad,Microsoft Word,блокнот.
javascript:var массив = []; for (let сч = 0; сч < 8; сч++) массив.push(parseFloat(prompt())); var произв_1 = массив[0], произв_2 = массив[4]; for (let сч = 0; сч < 2; сч++) { произв_1 *= массив[1 + сч]; произв_2 *= массив[5 + сч]; } alert(произв_1 + " " + произв_2);
Program tovar;
Var s, n, c: integer;
begin
Write ('Сколько единиц товара закупили?');
Read (n);
Write ('Какова цена товара?');
Read (c);
s:=c*n;
Write ('Стоимость общей партии товара равна', s, 'руб.');
end.
Using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace Dcoder
{
public class Program
{
public static void Main(string[] args)
{
Console.Write("Размер массива: ");
int n = Convert.ToInt32(Console.ReadLine());
int[] arr = new int[n];
Random rand = new Random();
for (int i = 0; i < arr.Length; i++)
arr[i] = rand.Next(1, 100);
for (int i = 0; i < arr.Length; i++)
if (arr[i] % 2 == 0)
Console.WriteLine(arr[i]);
Console.WriteLine();
for (int i = 0; i < arr.Length; i++)
if (arr[i] % 2 != 0)
Console.WriteLine(arr[i]);
Console.ReadLine();
}
}
}