using System;
using System.Collections.Generic;
using System.Collections.Specialized;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
int count = Convert.ToInt32(Console.ReadLine());
int price = Convert.ToInt32(Console.ReadLine());
int sum = count * price;
char lastNum = Convert.ToString(sum)[Convert.ToString(sum).Length - 1];
Console.Write(sum+" ");
if (lastNum == '1')
{
Console.Write("гривна");
}
else if(lastNum == '2' || lastNum == '3' || lastNum == '4')
{
Console.Write("гривны");
}
else
{
Console.Write("гривен");
}
}
}
}
const n=15;
var a:array[1..n] of real;
i:integer; b:boolean;
begin
Randomize;
for i:=1 to n do begin
a[i]:=-i+random()+20;
write(a[i]:5:2,' ');
end;
writeln;
b:=true;
for i:=1 to n-1 do
if a[i+1]>=a[i] then b:=false;
if b
then
begin
writeln('Последовательность убывающая');
writeln('p = ',a[n]*a[n div 2+1]:5:2);
end
else writeln('Последовательность не убывающая')
end.
Пример:
19.02 18.28 17.91 16.67 15.03 14.68 13.10 12.86 11.91 10.19 9.66 8.35 7.37 6.55 5.20
Последовательность убывающая
p = 66.86