1.文件复制:
#include
int main(void){
int i;
while((i=getchar())!=EOF){
putchar();
}
}
1.计数器
#include
int main(void){
int sun = 0;
while(getchar()!=EOF){
++sun;
}
printf("sun = %d\n",sun);
}
3.行计数
#include
int main(void){
int sun;
int nc=0;
while((sun=getchar())!=EOF){
if(sun =='\n'){
++nc;
}
}
}
阅读(1468) | 评论(0) | 转发(0) |