本帖最后由 黄兴旺 于 2013-4-7 12:39 编辑
- import java.util.*;
- class Main
- {
- public static void main(String[] args)
- {
- Scanner cin = new Scanner(System.in);
- int n = cin.nextInt();
- int m = cin.nextInt();
- int x,y;
- while (n!=0||m!=0)
- {
- if((m-n*2)%2==0)
- {
- y=(m-n*2)/2;
- x=n-y;
- if(x>=0&&y>=0)
- System.out.print(x);
- System.out.println(y);
- else
- System.out.println("Error");
- }
- else
- {
- System.out.println("Error");
- }
- }
- }
- }
复制代码 大神 怎么进了死循环。? |
|