C/C++の宿題を片付けます 116代目at TECH
C/C++の宿題を片付けます 116代目 - 暇つぶし2ch355:デフォルトの名無しさん
08/10/15 22:35:55
>>353 >>338
#include <stdio.h>
#include <string.h>
#define MAX 128
int main(void) {
char buf[MAX];
int i=1,ch;
FILE *tmp=tmpfile();
if(tmp==NULL) {perror(""); return 1;}
while (fgets(buf, MAX, stdin) != NULL) fwrite(buf,strlen(buf),1,tmp); /* function */
rewind(tmp);
do{
printf("%d: ",i++);
while((ch=fgetc(tmp))!='\n' && ch!=EOF) putchar(ch);
puts("");
}while( ch != EOF );
return 0; }



次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch