PDA

View Full Version : خطا در اجرای برنامه ماتریس مجاورت



kazeminejad
سه شنبه 24 دی 1392, 11:05 صبح
خیلی فوریه لطفا کمکم کنین.
برنامم با خطاهاشو نوشتم:
#include<iostream>
#include<conio.h>
using namespace std;
typedef struct node{ 
int fr,to,cost;
}p[4];

int c=0, temp=0, temp1=0;
void prims(a, *b[7][7], i, j);
void prims(int a, int *b[7][7], int i, int j){
a[i]=;
while (c>4){
int min=999;
for (int i=0, i<7, i++){
if(a[i]==1){
for(int j=0, j<7,){
if(b[i][j]>=min || b[i][j]=0)
j++;
else if(b[i][j]<min){
min=b[i][j];
temp=i;
temp1=j;
}
a[temp1]=1;
p[c].fr=temp;
p[c].to=temp;
p[c].cost=min;
c++;
b[temp][temp1]=b[temp1][temp]=1000;
}
for(int k=0, k<4, k++){
cout<<"sourse node: " << p[k].fr << end1;
cout<<"test ination node: " << p[k].to << end1;
cout<<"weight of node: " << p[k].cost << end1;
}
}
}
}
} ;

int main(){
int a[7];
for(int i=0, i<7, i++){
a[i]=0;
}
int b[7][7];
for(int i=0, i<7, i++){
cout<<"enter valuse for " << (i+1) << "row" << end1;
for(int j=0, j<7, j++){
cin>>b[i][j];
}
}
print(c, b, 0, 0);
getch();
}


http://up.iranblog.com/images/2u72uthsh4fbm266xduu.jpg