1.scanf() 速度比cin快,在输入大量数据时用scanf 2.scanf()遇到空格,回车会停止 getchar()则可以 循环读入数据 while((c=getchar())!=EOF) while(cin>>n&&n)