12. (2 banja)varj, s: integer; //nepemehhblearr: array[1..10] of integer; //maccubbeginarr[1] : = 16; arr[2] : = 20; arr[3] : = 20; arr[4] : = 41; arr[5] : = 14; arr[6] : = 21; arr[7] : = 28; arr[8] : = 12; arr[9] : = 15; arr[10] : = 35; s: = 100; forj: = 1 to 10 doif arr[j] < 25 thenbegins: = s + 1; end; writeln(s); end.
using System;
namespace NoNamespace.Task029 {
//Напишите консольное приложение на C#, находящее пару чисел меньше N,
//сумма цифр которых одинакова, и сообщающее, если таких чисел нет
internal class Program {
private static void Main() {
Console.WriteLine("Введите N");
var n = int.Parse(Console.ReadLine());
var sums = new int[n];
sums[0] = 1;
for (var i = 1; i < n; i++) {
sums[i] = NumberSum(i);
}
var found = false;
for (var i = 1; i < n; i++) {
if (sums[i] == 0) continue;
for (var j = i + 1; j < n; j++) {
if (sums[i] != sums[j]) continue;
Console.WriteLine($"Number sum {i} and {j} = {sums[i]}");
found = true;
}
}
if (!found)
Console.WriteLine("Nothing found");
Console.ReadKey();
}
private static int NumberSum(int number) {
var sum = 0;
while (number > 0) {
sum += number % 10;
number = number / 10;
}
return sum;
}
}
}
begin
var n := ReadInteger;
var a := arrRandom(n, 1, 100);
a.Println;
var p := BigInteger(1);
for var i := 0 to n - 1 do
if a[i] mod 2 = 0 then p := p * a[i];
p.Println
end.
Пример9067 13 96 10 94 24 16 2 43 94 60 60 56 88 28 27 75 32 90 18 70 32 6 23 81 57 38 73 25 6 20 52 56 33 38 79 20 81 67 49 33 29 43 36 74 46 13 14 30 93 72 8 10 99 89 35 8 73 30 37 86 43 78 38 75 9 4 24 50 49 8 95 65 42 85 42 90 71 50 35 45 25 44 33 34 13 43 57 45 4
752729749734296001571550469794689018400554807071967543296000000000000000