Advertisement
hombretao

toma_tu_wea

Oct 8th, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. int conteo = 0;
  2.         int n;
  3.  
  4.         Scanner ingreso = new Scanner( System.in );
  5.  
  6.         System.out.println( "Ingrese el Numero" );
  7.  
  8.         n = ingreso.nextInt();
  9.        
  10.         if( n < 3 )
  11.         {
  12.             System.out.println( "Error" );
  13.         }
  14.         else
  15.         {
  16.             for( int i = n; i > 0; i-- )
  17.             {
  18.                 if( i % 3 == 0 )
  19.                 {
  20.                     conteo++;
  21.                 }
  22.             }
  23.  
  24.             System.out.println(conteo);
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement