供参考:- class TestDemo
- {
- public static void main(String[] args)
- {
- int a =10;
- int count=0;
- for(int i=0;i<5;i++)
- {
- count++;
- if(a>12)
- continue;
- a++;
- }
- System.out.println(a+","+count);
-
- int b =10;
- count=0;
- for(int i=0;i<5;i++)
- {
- count++;
- if(b>12)
- break;
- b++;
- }
- System.out.println(b+","+count);
-
- System.out.println(sum(10,20));
- }
-
- public static int sum(int m,int n)
- {
- return m+n;
- }
- }
复制代码 |