TÓPICO
Não consigo ver o erro sinceramente.
shideki perguntou 6 years ago
using System; using System.Globalization; namespace teste { class Program { static void Main(string[] args) { int valor, contPar=0, contImpar=0, contPos=0, contNeg=0;
for(int i = 0; i<5; i++){
valor = int.Parse(Console.ReadLine());
if(valor == 0){
contPar += 1;
}
if(valor > 0){
if(valor % 2 == 0){
contPar += 1;
contPos++;
}
else{
contImpar += 1;
contPos++;
}
}
else if(valor < 0){
if(valor % 2 == 0){
contPar += 1;
contNeg++;
}
else{
contImpar += 1;
contNeg++;
}
}
}
Console.WriteLine(contPar + " valor(es) par(es)");
Console.WriteLine(contImpar + " valor(es) impar(es)");
Console.WriteLine(contPos + " valor(es) posito(s)");
Console.WriteLine(contNeg + " valor(es) negativo(s)");
}
}
}
Este tópico ainda não foi respondido. Seja o primeiro!