Tried to write more but no space on yahooanswers left so instructions are here. Plz help, so lost
http://gyazo.com/5511d504f32e18469af9e09af8ffdf0e
http://gyazo.com/05be4f8784cdb233a84118c41e86a49d
http://gyazo.com/8c82023fac1d77ea36f68ae253677bb5
http://gyazo.com/be3566819de8a63602b2a4d452dfcba8
#include
int main() {
int n, w, s, r, weeks, workouts, sets, reps;
int avg = 0, sum_reps = 0, best_workout = 0;
char name[20];
FILE * ifp;
ifp = fopen("input.txt", "r");
fscanf(ifp, "%s", name);
printf("%s", name);
fscanf(ifp, "%d", &weeks);
for(n=1; n<=weeks; n++){
printf("\n\nWeek %d", n);
fscanf(ifp, "%d", &workouts);
for(w=1; w<=workouts; w++){
printf("\nWorkout %d:", w);
fscanf(ifp, "%d", &sets);
for(s=0; s
fscanf(ifp, "%d", &reps);
if(reps >= 10){
printf("*");
sum_reps += 1;
}
if ( ){
;
}
}
}
}
printf("\n\nYour best workout was in week %d and contained %d sets of an average of %d reps.\n\n",best_workout, sum_reps, avg);
return 0;
}