using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Global
{
class Program
{
static void Main(string[] args)
{
string first_x = Console.ReadLine();
int first_input = Convert.ToInt16(first_x);
int y = 1 - first_input;
y = y + 3 * Get_x();
y = y - 4 * Get_x();
Console.Write(y);
Console.Read();
}
static int Get_x()
{
string input = Console.ReadLine();
int x = Convert.ToInt16(input);
return x;
}
}
}
Объяснение:
var a,b,c:integer;
begin
writeln (' введите число');
readln(a);
b:=a mod 10;
a:=a div 10;
c:=a mod 10;
a:=a div 10;
if (a = b) or (a=c) or (b = c)then writeln ('такие числа есть')
else writeln('таких чисел нет');
end.
zadacha_2;
var a:integer;
begin
writeln(' введите время в минутах');
readln(a);
a:=a mod 10;
if ((a >= 0) and (a <= 3)) or ((a > 5) and (a <= 8)) then writeln('зелёный');
if ((a > 3) and (a <= 5)) or ((a > 8) and (a < 0)) then writeln('жёлтый');
end.