= 팀명 = What Does The Fox Say? = 팀원 = Senior : [장혁수] Junior : [최다인] = 코드 = Phase Final {{{ #include #include #include int main () { int max = INT_MIN, row, column; bool isInt = true, isSusic = true; char simbol; FILE* fp = fopen("file.txt", "r"); char *string = (char*)malloc(sizeof(char)*1024); char *x = (char*)malloc(sizeof(char)*1024); char *y = (char*)malloc(sizeof(char)*1024); int *num = (int*)malloc(sizeof(int)*row*column); fscanf(fp, "%d %d\n", &row, &column); for(int i = 0; i < row * column; i++) { memset(string, 0, sizeof(char)*1024); memset(x, 0, sizeof(char)*1024); memset(y, 0, sizeof(char)*1024); fscanf(fp, "%s", string); for(int j=0; string[j] != '\0' ; j++) { if(isdigit(string[j])|| (j == 0 && string[j] == '-')) { isInt = true; isSusic = false; continue; } else if(j != 0 && (string[j] == '+' || string[j] == '-' || string[j] == '*')) { simbol = string[j]; int k; for(k=0;k max) { max = *(num + (i * column) + j); } } if(max == INT_MIN) printf("row %d: %s\n", i +1, "NaN"); else printf("row %d: %d\n", i +1, max); max = INT_MIN; } for(int i = 0; i < column; i++) { for(int j = 0; j < row; j++) { if(*(num + (column * j) + i) > max) { max = *(num + (column * j) + i); } } if(max == INT_MIN) printf("column %d: %s\n", i +1, "NaN"); else printf("column %d: %d\n", i +1, max); max = INT_MIN; } for(int i = 0; i < row; i++) { for(int j = 0; j < column; j++) { if(*(num + (i * column) + j) > max) { max = *(num + (i * column) + j); } } } if(max == INT_MIN) printf("matrix: %s\n","NaN"); else printf("matrix: %d\n", max); return 0; } }}} ----- [Code Race/2014.8.20]