输入方法

1.eof

1
2
3
while(scanf("%d",&n)!=EOF){

}

2.条件读入

1
2
while(scanf("%d",&n)!=-1){
}

3.for