MCPcopy Create free account
hub / github.com/TonyD0g/JavaHacker / ArrayStruct

Class ArrayStruct

0 Java开发基础/0.UDF/ArrayStruct.java:8–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 int x,y;
7}
8public class ArrayStruct {
9 static Scanner in=new Scanner(System.in);
10
11 public static void main(String[] args) {
12 int n=in.nextInt();
13 p a=new p();
14 a.x=10;
15 //最大n值 : 3
16 p[] b=new p[3];
17 for(int i=0;i<3;i++){//一定要加入这一句
18 b[i]=new p();
19 }
20 for(int i=0;i<n;i++){
21 b[i].x=1;
22 b[i].y=2;
23 }
24 for(int i=0;i<n;i++){
25 System.out.println(b[i].x+b[i].y);
26 }
27 }
28}
29
30
31

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected