Advertisement
teaowl

console operator

Oct 15th, 2017
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. package exp;
  2.  
  3. public class Weight {
  4.  
  5.     public static void main(String[] args) {
  6.         int num = Integer.parseInt(args[0]);
  7.         int a = Integer.parseInt(args[1]);
  8.         int b = Integer.parseInt(args[2]);
  9.         int c = Integer.parseInt(args[3]);
  10.         Thing arr[] = new Thing[num];
  11.         for(int i = 0; i<num;i++){
  12.             arr[i] = new Thing();
  13.             arr[i].a = a;
  14.             arr[i].b = b;
  15.             arr[i].c = c;
  16.             System.out.println("переменная #"+i+", a="+arr[i].a+", b="+arr[i].b+", c="+arr[i].c);
  17.         }
  18.     }
  19. }
  20.  
  21. class Thing{
  22.     int a;
  23.     int b;
  24.     int c;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement