int a=0; int c=0; do{ –-c; a=a-1; }while(a>0); System.out.println(a+" "+c);
时间: 2024-05-05 18:15:45 浏览: 70
java 中 System.out.println()和System.out.write()的区别
As an AI language model, I can see that the given code will result in a syntax error because of the missing "+" or "-" operator between "a" and the string to print. Here's the corrected code with the assumption that the missing operator is "-":
```
int a = 0;
int c = 0;
do {
--c;
a = a - 1;
} while (a > 0);
System.out.println(a + " " + c);
```
This code will decrement the value of "c" by 1 in each iteration and "a" by 1 until "a" becomes less than or equal to 0. Finally, it will print the value of "a" and "c" separated by a space. Since the initial value of "a" is 0, the loop will not execute even once, resulting in the output "0 -1".
阅读全文