alonsosjumper

Ej6 pr7

Jun 12th, 2011
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. void Subvencion(Grafo G)
  2. {
  3. tCoste A[G->numVert][G->numVert];
  4. vertice P[G->numVert][G->numVert];
  5.  
  6. int i,j,aux;
  7. aux=1;
  8.  
  9. Floyd(G,A,P);
  10. printf("Aplicamos Floyd:\n");
  11. for(i=0;i<G->numVert;i++)
  12. {
  13. for(j=0;j<G->numVert;j++)
  14. printf("%d ",A[i][j]);
  15. printf("\n");
  16. }printf("\n");
  17. ImprimirGrafo(G);
  18. for(i=0;i<G->numVert;i++)
  19. {
  20. for(j=0;j<G->numVert;j++)
  21. if(A[i][j]==-1)
  22. aux=0;
  23. }
  24. if(aux==1)
  25. printf("\nEl grafo tiene ciclos. Lo sentimos, no ha conseguido la subvencion\n");
  26. else
  27. printf("\n!Enhorabuena, su grafo es aciclico. Nos pondremos en contacto con usted\n");
  28. }
Advertisement
Add Comment
Please, Sign In to add comment