#include #include #include #include int main(int argc, char **argv) { int prob=1; int p; char line[1000]; FILE *bla = fopen("fuses.in", "r"); char tok[1000]; int seq; int neu; int neustr, maxstr; int i,n,m, c; int amp[100]; int ein[100]; while(1) { fgets(line, 1000, bla); n = atoi(strtok(line, " ")); m = atoi(strtok(NULL, " ")); c = atoi(strtok(NULL, " ")); if((n==0) && (m==0) && (c==0)) exit(0); for (i=0;imaxstr) || (maxstr==-1)) maxstr = neustr; } if(maxstr>c) printf("Sequence %d\nFuse was blown.\n\n", prob); else printf("Sequence %d\nFuse was not blown.\nMaximum power consumption was %d amperes.\n\n", prob, maxstr); prob++; } }