C/C++の宿題を片付け ..
[2ch|▼Menu]
657:デフォルトの名無しさん
07/05/22 01:42:23
>>654
#include<stdio.h>
#include<stdlib.h>
#define N 256
struct list{
char data[N];
list *next;
};
int main(){
list *top = NULL, *now;
int i = 0;
while(1){
now = (list*)malloc(sizeof(list));
now->next = top;
printf("入力: ");
if(fgets(now->data,N,stdin) == NULL) break;
top = now;
}
now = now->next;
while(now){
printf("出力: %s",now->data);
top=now;
now = now->next;
free(top);
}
return 0;
}
眠い頭でうあったからあってるかどうかしらね


次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

4287日前に更新/299 KB
担当:undef