Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public static void main(String[] args){
  2.  
  3. //A)
  4. int[] f = {10,2,4,5,4,3,8,9,2,3};
  5. System.out.println (f[6]);
  6.  
  7. //B)
  8. float g[];
  9. g = new float [10];
  10. g[5]= 5;
  11.  
  12. //C)
  13. int arregloEnteros[];
  14. arregloEnteros = new int [1001];
  15. for (int i = 0; 1 <=1000; i++){
  16. arregloEnteros [i] = 1;
  17. }
  18. //D)
  19. int[] arregloA = new int[10];
  20. int[] arregloB= new int[20];
  21. for (int j = 2; j < arregloA.length; j++){
  22. arregloB[j]=arregloA[j-2];
  23. }
  24.  
  25. //E)
  26. int[][] matriz = new int[3][3];
  27. matriz[0][0] = 1;
  28. matriz[0][2] = 3;
  29. matriz[0][1] = 2;
  30. matriz[1][0] = 4;
  31. matriz[1][1] = 5;
  32. matriz[1][2] = 6;
  33. matriz[2][0] = 7;
  34. matriz[2][1] = 8;
  35. matriz[2][2] = 9;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement