C++写法:
while(scanf("%d",&a)!=0){
cout << a << endl;
}
注意C++需要前文追加以下代码防止cin/cout超时:
ios::sync_with_stdio(false);
Java写法:
错误示例:
while(ss.nextLine()!=0) {
System.out.println();
}
正确示例:
String line="";
while(!(line=ss.nextLine()).equals("0")) {
System.out.println(line);
}



