TOPIC
Wrong answer (100%) C#
PedroLucas5 asked 2 months ago
Não consigo fazer meu código ser aprovado. rs fiz com if e com for e não vai de jeito nenhum :'(
using System;
class URI {
static void Main(string[] args) {
int[] vet = new int[] { 100, 50, 20, 10, 5, 2, 1 };
//Console.WriteLine("Digite o valor");
int N = int.Parse(Console.ReadLine());
Console.WriteLine(N);
if (0 < N && N < 1000000)
{
for (int i = 0; i < vet.Length; i++)
{
int notas = N / vet[i];
Console.WriteLine(notas + " nota(s) de R$ " + vet[i].ToString("F2"));
N = N % vet[i];
}
}
}
}