哪位大神能帮忙解决啊?
#include<iostream>//#include <iomanip>
#include <stdio>
using namespace std;
#define m 1000 //表示两点间不可达,距离为无穷远
#define n 9 //结点的数目
//void dijkstra(int C[][n],int v);//求原点v到其余顶点的最短路径及其长度
void dijkstra(int C[][n],int v);
{
int i,j,k,l,p,q,u,v,s,w;
int L(k+1);//表示从1点到k+1点的距离
cout<<1<<"到"<<1<<"的最短距离为0"<<endl;
cout<<"路径为:"<<1<<"-->"<<1<<endl;
for(k=1;k<9;k++)
{
for(i=0;i<n;i++)//查找第1排
{
if(C[0][i] != m)
{
if(i=k)
{
for(j=0;j<n;j++)//查找第2排
{
if(C[i][j] != m)
{
if(j=k)
{
C[0][i]+C[i][j]=L(k+1);
if(C[0][k]>L(k+1))
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<C[0][k]<<endl;
cout<<"路径为:"<<1<<"-->"<<k<<endl;
}
else
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<L(k+1)<<endl;
cout<<"路径为:"<<1<<"-->"<<i<<"-->"<<j<<endl;
}
}
else
{
for(l=0;l<n;l++)//查找第3排
{
if(C[j][l] != m)
{
if(l=k)
{
C[0][i]+C[i][j]+C[j][l]=L(k+1);
if(C[0][k]>L(k+1))
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<C[0][k]<<endl;
cout<<"路径为:"<<1<<"-->"<<k<<endl;
}
else
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<L(k+1)<<endl;
cout<<"路径为:"<<1<<"-->"<<i<<"-->"<<j<<"-->"<<l<<endl;
}
}
else
{
for(p=0;p<n;p++)//查找第4排
{
if(C[l][p] != m)
{
if(p=k)
{
C[0][i]+C[i][j]+C[j][l]+C[l][p]=L(k+1);
if(C[0][k]>L(k+1))
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<C[0][k]<<endl;
cout<<"路径为:"<<1<<"-->"<<k<<endl;
}
else
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<L(k+1)<<endl;
cout<<"路径为:"<<1<<"-->"<<i<<"-->"<<j<<"-->"<<l<<"-->"<<p<<endl;
}
}
else
{
for(q=0;q<n;q++)//查找第5排
{
if(C[p][q] != m)
{
if(q=k)
{
C[0][i]+C[i][j]+C[j][l]+C[l][p]+C[p][q]=L(k+1);
if(C[0][k]>L(k+1))
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<C[0][k]<<endl;
cout<<"路径为:"<<1<<"-->"<<k<<endl;
}
else
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<L(k+1)<<endl;
cout<<"路径为:"<<1<<"-->"<<i<<"-->"<<j<<"-->"<<l<<"-->"<<p<<"-->"<<q<<endl;
}
}
else
{
for(u=0;u<n;u++)//查找第6排
{
if(C[q][u] != m)
{
if(u=k)
{
C[0][i]+C[i][j]+C[j][l]+C[l][p]+C[p][q]+C[q][u]=L(k+1);
if(C[0][k]>L(k+1))
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<C[0][k]<<endl;
cout<<"路径为:"<<1<<"-->"<<k<<endl;
}
else
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<L(k+1)<<endl;
cout<<"路径为:"<<1<<"-->"<<i<<"-->"<<j<<"-->"<<l<<"-->"<<p<<"-->"<<q<<"-->"<<u<<endl;
}
}
else
{
for(v=0;v<n;v++)//查找第7排
{
if(C[u][v] != m)
{
if(v=k)
{
C[0][i]+C[i][j]+C[j][l]+C[l][p]+C[p][q]+C[q][u]+C[u][v]=L(k+1);
if(C[0][k]>L(k+1))
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<C[0][k]<<endl;
cout<<"路径为:"<<1<<"-->"<<k<<endl;
}
else
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<L(k+1)<<endl;
cout<<"路径为:"<<1<<"-->"<<i<<"-->"<<j<<"-->"<<l<<"-->"<<p<<"-->"<<q<<"-->"<<u<<"-->"<<v<<endl;
}
}
else
{
for(s=0;s<n;s++)//查找第8排
{
if(C[v][s] != m)
{
if(s=k)
{
C[0][i]+C[i][j]+C[j][l]+C[l][p]+C[p][q]+C[q][u]+C[u][v]+C[v][s]=L(k+1);
if(C[0][k]>L(k+1))
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<C[0][k]<<endl;
cout<<"路径为:"<<1<<"-->"<<k<<endl;
}
else
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<L(k+1)<<endl;
cout<<"路径为:"<<1<<"-->"<<i<<"-->"<<j<<"-->"<<l<<"-->"<<p<<"-->"<<q<<"-->"<<u<<"-->"<<v<<"-->"<<s<<endl;
}
}
else
{
for(w=0;w<n;w++)//查找第9排
{
if(C[s][w] != m)
{
if(w=k)
{
C[0][i]+C[i][j]+C[j][l]+C[l][p]+C[p][q]+C[q][u]+C[u][v]+C[v][s]+C[s][w]=L(k+1);
if(C[0][k]>L(k+1))
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<C[0][k]<<endl;
cout<<"路径为:"<<1<<"-->"<<k<<endl;
}
else
{
cout<<1<<"到"<<k+1<<"的最短距离为"<<L(k+1)<<endl;
cout<<"路径为:"<<1<<"-->"<<i<<"-->"<<j<<"-->"<<l<<"-->"<<p<<"-->"<<q<<"-->"<<u<<"-->"<<v<<"-->"<<s<<"-->"<<w<<endl;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
void main()
{
cout<<" ——Dijkstra算法的程序实现——"<<endl;
int C[n][n]={
{m,3,5,20,26,4,m,m,m},
{4,m,m,5,4,m,20,m,m},
{9,m,m,m,4,8,m,m,m},
{18,4,m,m,m,m,9,m,25},
{20,2,6,m,m,m,7,8,30},
{5,m,3,m,m,m,m,m,30},
{m,5,m,5,1,m,m,m,25},
{m,m,4,m,6,2,m,m,10},
{m,m,m,m,25,m,4,9,m}
};
int i,j;
int v = 1;
cout<<"输出有向图的邻接矩阵"<<endl;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
cout<<setw(10)<<C[i][j] ;
}
cout<<endl;
}
cout<<"输出原点1到其他各点的最短路径及其长度"<<endl;
dijkstra(C,v);
}
出现这样的问题,求大神指导
fatal error C1083: Cannot open include file: 'stdio': No such file or directory
Error executing cl.exe.