Thank you for the idea.I managed to sort the data. Now I'm having trouble to calculate the average of 'b' (sum/k).
I got the sum, but don't know how to calculate the k value.
Here's the code to...
Type: Posts; User: zmi
Thank you for the idea.I managed to sort the data. Now I'm having trouble to calculate the average of 'b' (sum/k).
I got the sum, but don't know how to calculate the k value.
Here's the code to...
for(i=0;i<n;i++){
fscanf(fin,"%f,%f\n",&a[i],&b[i]);
}
for(i=0;i<n;i++){
if (a[i]==60){
k=k+1;
sum=sum+b[i];
}
Hi. I have a problem that I could not figure out. I have these datasets read from a textfile (1 to N):
a1 b1
a2 b2
a3 b3
:
:
aN bN
I need to make this: