Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package javaapplication1;
  6.  
  7. class A
  8. {
  9. int [] tab;
  10.  
  11.  
  12.  
  13. A(int rozm)
  14. {
  15. tab=new int [rozm];
  16.  
  17. }
  18. void PrintTab()
  19. {
  20.  
  21. for (int i=0;i<tab.length;i++)
  22. {
  23. for (int k=tab.length/2-2;k<tab.length/2+2;k++)
  24. tab[k]=1;
  25.  
  26.  
  27. System.out.print(tab[i]+" ");
  28. }
  29.  
  30.  
  31.  
  32. }
  33. }
  34. /**
  35. *
  36. * @author Użytkownik
  37. */
  38. public class JavaApplication1 {
  39.  
  40. /**
  41. * @param args the command line arguments
  42. */
  43.  
  44.  
  45. public static void main(String[] args) {
  46. A p,l;
  47.  
  48. l=new A(12);
  49. l.PrintTab();
  50.  
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement