Re: [問題] 花了很久的時間
看板C_and_CPP (C/C++)作者tsaiminghan (nahgnimiast)時間16年前 (2010/03/14 03:12)推噓1(1推 0噓 0→)留言1則, 1人參與討論串2/3 (看更多)
下面把input的資料,都印到output
,其他請你自行改一下吧。
char line[1024];
FILE *inp = fopen ("input.txt", "r");
FILE *outp = fopen ("output.txt", "w");
if(inp && outp)
{
while(EOF != fscanf(inp, "%[^\n]\n", line))
{
fprintf(outp, "%s\n", line);
}
}
fclose (inp);
fclose (outp);
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.121.138.187
推
03/14 20:59, , 1F
03/14 20:59, 1F
討論串 (同標題文章)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章