>>423
何をしたいのか意味が分からんので
ヒントは無視して、ソースから適当に判断したから
検討違いだったらスマソ
あと、コンパイル&実行してないからミスってるかも知れんので
エラーが出たら自分で直してね

#include <stdio.h>
#include <stdlib.h>
#define NMAX 10

int *inputgraph(){
  int i,j,k,n,*p=NULL;
  puts("input the number of vertices:");
  if((scanf("%d%*[^\n]",&n)==1)&&n<=NMAX){
    if((p=calloc(n*n+1,sizeof(*p)))){
      *p=n;
      puts("input the numbers of two vertices connected by a side:");
      while(scanf("%d%d%d%*[^\n]",&i,&j,&k)==3)
        if(--i<NMAX&&--j<NMAX)p[i*n+j+1]=k,p[j*n+i+1]=k;}}
  return p;}