MCPcopy Create free account
hub / github.com/DuGuQiuBai/Java / main

Method main

day21/code/java/ForTest2.java:14–33  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

12*/
13class ForTest2 {
14 public static void main(String[] args) {
15 //�����
16 //System.out.println(1+2+3+4+5+6+7+8+9+10);
17
18 //��ѭ���������
19 int sum = 0;
20
21 for(int x=1; x<=10; x++) {
22 //x=1,2,3,4,...10
23
24 //sum = sum + x; //sum=0 + 1 = 1;
25 //sum = sum + x; //sum=1 + 2 = 3;
26
27 //sum = sum + x;
28
29 sum += x;
30 }
31
32 System.out.println("1-10�ĺ��ǣ�"+sum);
33 }
34}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected