/* ID: superso1 LANG: C TASK: gift1 */ #include #include #include int match_name(char *name, char library[10][14]) { int i=0; for(;i<10;i++) { if(!strcmp(library[i],name)) return i; } return -1; } int main(void) { FILE *fin=fopen("gift1.in", "r"); FILE *fout=fopen("gift1.out", "w"); int NP; char names[10][14]; int money[10]; int f=0; int i=0; char giver[14]; int amount_give; int people; char recv[10]; memset(money,0,10*sizeof(int)); //first see how many people there are fscanf(fin,"%d",&NP); //store the names for(;f0) money[match_name(giver,names)]+=amount_give%people; //amount left over after gift fprintf(stderr,"=HI=\n"); //give the recipients their cash for(i=0;i