int n = Convert.ToInt32(Console.ReadLine())
Объяснение:
Это Ввод данных. Первые две задачи выполнены хорошо. Если хочешь вводить число n , то в вызове метода убери параметры и оставь свободным.
static void Main()
{
(10,45);
ShowSequenceOfOddNumbers(5);
CreateAndShowArray(); // Вот так
}
А чтоб вводить число добавь строку "Ввода данных"
int n = Convert.ToInt32(Console.ReadLine())
Например:
tatic void CreateAndShowArray() // Пустой параметр
{
int n = Convert.ToInt32(Console.ReadLine())
long p = 1;
for (int i = 0; i < n; i++)
{
a[i] = new Random().Next(0, 100);
Console.Write(a[i] + " ");
p *= a[i];
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var a: array[0..100,0..100] of integer;
n, m, i, j, max, col: integer;
begin
read(n);
read(m);
for i: =0 to n-1 do
for j: =0 to m-1 do
begin
read(a[i,j]);
if max< a[i,j] then max: =a[i,j];
end;
for i: =0 to n-1 do
for j: =0 to m-1 do
if max=a[i,j] then begin inc(col); break; end;
writeln(col);
for i: =0 to n-1 do
for j: =0 to m-1 do
if max=a[i,j] then begin write(i, ' '); break; end;
end.