/* void pln() { printf("\n============================================================================\n\n"); return; } */ int main() { FILE *fp; int i, j; float orig[M][N] = {{5,2,4,4,3},{5,2,4,4,0},{1,1,1,1,1},{5,2,4,4,3},{5,2,4,4,3}}; float tran[M][N]; float u[M][2]; float v[2][N]; // memset(u,1,sizeof(u)); for (i = 0; i < M; i++) for ( j = 0; j < 2; j++) u[i][j] = v[j][i] = 1; print(M,2,u); // pln(); print(2,N,v); // pln(); int a, b, c; /*fp = fopen("data.txt","r"); memset(orig,0,sizeof(orig)); print(M,N,orig); while(getc(fp) != EOF) { fseek(fp,-1,SEEK_CUR); fscanf(fp,"%d%d%d",&a,&b,&c); orig[a][b] = c; } // pln();*/ print(M,N,orig); // fclose(fp); findresult(orig,tran,u,v); return 0; }
int main(void) { int i=1; double a, b, c, d; FILE *fp; fp = fopen("./data.txt", "r"); while (!feof(fp)) { printf("Case %d: ", i); fscanf(fp, "%lf %lf %lf %lf\n", &a,&b,&c,&d); findresult(a, b, c, d); i++; } fclose(fp); return 0; }