#include <iostream>
#include <bits/stdc++.h>
#include <iomanip>
#include <cmath>
#define Size 100
using namespace std;
int main(){
char ch[Size];
int i,j,k,h,n=1,count=0,elem=0;
cout<<"请输入该图形的邻接矩阵: (只输入数字即可)"<<endl;//获得用户输入的邻接矩阵
gets(ch);
for(i=0;ch[i] != '\0';i++){
if(ch[i] !=' ')
count++;
}
do{
if(count == pow(n,2))
break;
else
n++;
if(n==10)
cout<<"你输入的数据有误,请重新输入!"<<endl;//邻接矩阵必须为 n*n 的形式,否则为输入错误!
}while(1);
cout<<"该图形的邻接矩阵是:"<<endl;
for(i