Advertisement
gwserver

Uso de índice

Apr 20th, 2021
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1. public class Main {
  2.  
  3.     public static void main(String[] args) {
  4.  
  5.         int[] naoDivisiveisPor5 = new int[99];
  6.  
  7.         for (int contador = 1; contador < 100; contador++) {
  8.  
  9.             if (contador % 5 == 0) {
  10.                 continue;
  11.             }
  12.             naoDivisiveisPor5[contador-1] = contador;
  13.  
  14.             System.out.print(naoDivisiveisPor5[contador-1] + " ");
  15.  
  16.         }
  17.  
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement