依次读入数据,直到文件结束:
C/C++:
while (scanf("%d",&n)==1)
或
while (scanf("%d",&n)!=-1)
JAVA:
Scanner cin = new scanner(System.in);
while(cin.hasNext())
Python:
for line in sys.stdin:
依次读入数据,直到文件结束:
C/C++:
while (scanf("%d",&n)==1)
或
while (scanf("%d",&n)!=-1)
JAVA:
Scanner cin = new scanner(System.in);
while(cin.hasNext())
Python:
for line in sys.stdin: