#include <stdio.h>
int main(){
FILE* f1=fopen("a.txt","r");
char buf[256];
if(f1==NULL){
perror("Error opening file");
}
while(!feof(f1)){
int a=getc(f1);
if(a='1'){
ungetc('2',f1);
}
if(fgets(buf,255,f1)){
fputs(buf,stdout);
}
}
}
输入流