ぼるじょあがC/C++の宿題を片づけますYO! 68代目at TECH
ぼるじょあがC/C++の宿題を片づけますYO! 68代目 - 暇つぶし2ch542:さとみ
07/10/23 20:22:42
#include <stdio.h>
#include <stdlib.h>
struct node{ int data;
struct node *next;
};
struct node *head;
void add_head(int x)
{ struct node *p;
p = (struct node *)malloc(sizeof(struct node));
p->data = x;
p->next = head;
head = p;}
void print_list(struct node *q)
{ struct node *p;
printf("list\n");
for(p = q;p != NULL;p = p->next){
printf("%d\n"p->data);}}
main(int argc, char *argv[])
{ int i, val, n;
head = NULL;
n = atoi(argv[1]);
for(i = 0;i < n; i++){
scanf("%d",&val);
add_head(val);}
print_list(head);
return(0);}
コンパイルしてみた結果二箇所にエラーが発生しました
間違えたどころどうか直してもらえないでしょうか
お願いします


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