大于0的数累加直到输入0结束,这个怎么敲的啊,我不会初学者多见谅
package net.lesscoding;
import java.util.Scanner;
/**
* @author eleven
* @date 2021/9/9 13:30
* @apiNote
*/
public class ElevenTest {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Integer x;
Integer sum = 0;
while((x = scanner.nextInt()) != 0){
sum += x;
}
System.out.println(sum);
}
}
while(输入() && 输入!= 0)
{
干
}