# TOPIC

5% error in Java

#### Guilherme Barros Marins do Nascimento asked 2 years ago

import java.io.IOException; imprto java.util.Scanner;

public class Main {

``````public static void main(String[] args) throws IOException {
Scanner sca = new Scanner(System.in);

int N = sca.nextInt();

if (1000000 > N && N > 0){
boolean b  = true;
}
int cem = N / 100;
int cemm = N - cem * 100;

int cinq = cemm / 50;
int cinqm = cemm - cinq * 50;

int vint = cinqm / 20;
int vintm = cinqm - vint * 20;

int dez = vintm / 10;
int dezm = vintm - dez * 10;

int cin = dezm / 5;
int cinm = dezm - cin * 5;

int dos = cinm / 2;
int dosm = cinm - dos * 2;

int um = dosm / 1;
int umm = dosm - um *1;

System.out.println(cem + " nota(s) de R\$ 100,00");
System.out.println(cinq + " nota(s) de R\$ 50,00");
System.out.println(vint + " nota(s) de R\$ 20,00");
System.out.println(dez + " nota(s) de R\$ 10,00");
System.out.println(cin + " nota(s) de R\$ 5,00");
System.out.println(dos + " nota(s) de R\$ 2,00");
System.out.println(um + " nota(s) de R\$ 1,00");
}``````

}

Remember not post solutions. Your post may be reviewed by our moderators.

• #### Nimus replied 2 years ago

imprime o valor de N