int main(){ freopen("input.txt", "r", stdin); int T; scanf("%d", &Case); while(Case--){ readCase(); solveCase(); printCase(); initVisited(); } return 0; }
int main(){ freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); scanf("%d", &Case); while (Case--){ readCase(); solveCase(); printCase(); if (Case) printf("\n"); } return 0; }
int main(){ freopen("input.txt", "r", stdin); Case = 0; while (2 == scanf("%d %d", &W, &H) && W && H) { Case++; initCase(); readCase(); solveCase(); sortResult(); printCase(); } return 0; }
/********************************* * * * printTerm * * * *********************************/ static void printTerm(PE_TERM *term) { assert(term); switch (term->tag) { case T_STRUCTOR: printf("%s", term->info.struct_name); break; case T_MACRO: printf("%s", term->info.macro->macro_name); break; case T_FUNCTION: printf("%s", term->info.function->fun_name); break; case T_CASE: printCase(term->info.cases); break; case T_RECORD: printRecord(term->info.records); break; case T_FOLD: printFold(term->info.folds); break; case T_MAP: printMap(term->info.maps); break; case T_UNFOLD: printUnfold(term->info.unfolds); break; default: printf("printTerm(): term not recognized\n"); exit(-1); break; } }