Bonjour
SVP je suis bloqué écossais de compiler ce programme pour mes élèves mais j'arrive pas.
Je comprends pas mes erreurs.
Compilation failed due to following error(s).main.cpp: In function ‘void PintMat(int (*)[10], int)’:Code:#include <iostream> #include <iomanip> using namespace std ; // A function to print the adjacency matrix. void PintMat(int mat[][10],int n){ int i,j; cout<<"\n\n"<<setw(4)<<" "; for(i=0;i<n; i++) cout<<setw(3)<<"("<<i+1<<")"; cout<<"\n\n"; //Print 1 if the corresponding vertexesare connected otherwise 0. for(i=0;i<n;i++){ cout<<setw(3)<<"("<<i+1<<")"; for(j=0;j<n;j++){ cout<<setw(4)<<mat[i][j]; } cout<<"\n\n"; } main(){ int i,j,v; cout<<"enter the number of vertexes:"; cin>>v; int mat[10][10] cout<<"\n"; //Take input of the adjacency of each pair of vertexes. for(i=0;i<v;i++){ for (j=i;j<v;j++){ if(i!=j){ cout<<"enter 1 if vertex"<<i+1<<"is adjacent to"<<j+1<<" , otherwise 0: "; cin>>mat[i][j]; mat[i][j]=mat[i][j]; } else mat[i][j]=0; } } PrintMat(mat,v); return 0; } //Lets run the program.
main.cpp:26:6: error: ‘main’ was not declared in this scope
main(){
^
main.cpp:47:1: error: expected ‘}’ at end of input
}
-----