實驗源代碼
//Warshall.cpp #include<stdio.h> void warshall(int k,int n) { int i , j, t; int temp[20][20]; for(int a=0;a<k;a++) { printf("請輸入矩陣第%d 行元素:",a); for(int b=0;b<n;b++) { scanf ("%d",&temp[a][b]); } } for(i=0;i<k;i++){ for( j=0;j<k;j++){ if(temp[ j][i]==1) { for(t=0;t<n;t++) { temp[ j][t]=temp[i][t]||temp[ j][t]; } } } } printf("可傳遞閉包關系矩陣是:\n"); for(i=0;i<k;i++) { for( j=0;j<n;j++) { printf("%d", temp[i][ j]); } printf("\n"); } } void main() { printf("利用 Warshall 算法求二元關系的可傳遞閉包\n"); void warshall(int,int); int k , n; printf("請輸入矩陣的行數 i: "); scanf("%d",&k);
四川大學實驗報告 printf("請輸入矩陣的列數 j: "); scanf("%d",&n); warshall(k,n); }
標簽:
warshall
離散
實驗
上傳時間:
2016-06-27
上傳用戶:梁雪文以
This edition updates and continues the series of books based on the residential
courses on radiowave propagation organised by the IEE/IET.
The first course was held in 1974, with lectures by H. Page, P. Matthews,
D. Parsons, M.W. Gough, P.A. Watson, E. Hickin, T. Pratt, P. Knight, T.B. Jones,
P.A. Bradley, B. Burgess and H. Rishbeth.
標簽:
Propagation
Radiowaves
edition
3rd
of
上傳時間:
2020-05-31
上傳用戶:shancjb