Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int conteo = 0;
- int n;
- Scanner ingreso = new Scanner( System.in );
- System.out.println( "Ingrese el Numero" );
- n = ingreso.nextInt();
- if( n < 3 )
- {
- System.out.println( "Error" );
- }
- else
- {
- for( int i = n; i > 0; i-- )
- {
- if( i % 3 == 0 )
- {
- conteo++;
- }
- }
- System.out.println(conteo);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement