0

Where is my error

using System; namespace ConsoleApp8 { class Program { static void Main(string[] args) { int n = Convert.ToInt32(Console.ReadLine()); int[] z = new int[n - 1]; int neg = 0, pos = 0, zer = 0; for (int i = 0; i < n; i++) { z[i] = Convert.ToInt32(Console.ReadLine()); if (z[i] > 0 ) { neg++; } else if (z[i] < 0) { pos++; } else { zer++; } } Console.Write(neg); Console.Write(" "); Console.Write(zer); Console.Write(" "); Console.Write(pos); } } }

25th Jun 2022, 8:03 PM
Arash
Arash - avatar
2 odpowiedzi
0
SoloLearn only takes a "Console.ReadLine" at the start of the program. So you cant have it inside of a loop. Try pasting your code in visual studio instead (or any other IDE)
27th Jun 2022, 11:11 AM
Vooijs54
- 1
That'snot work
26th Jun 2022, 3:55 AM
Arash
Arash - avatar