So first I need to input number using scanf separated by white space in to an array like this :
How many hours : 4
How many minutes for #1 : 10 6 55
How many minutes for #2 : 30 50 60
How many minutes for #3: 60 30 50
How many minutes for #4 : 6 7 9
The finest hours are #2 and #3
The score is %d and the Standard Derivation is ___.
"Hours" input can be anything
Can only use stdio.h and math.h
What I have tried:
I have tried using while loop to find sum
to store in first array then calculate SD with
function command store in another array
but somehow it end up like this so I try to make it
Work at least finding sum of all minutes first.
How many minutes for #1: 1 2 3
How many minutes for #2:
How many minutes for #3:
How many minutes for #4: input able here
so it just skip from 1 to 4
not let me do input in #2 and #3
*I use scanf for most of input
This is finding sum part of the code
If (hours >= 1 && hours <= 60)
{
for(int i = 1; i < hours-1; ++I)
{
printf("\nHow many minutes for #1:",i);
scanf("%d", &minutes);
sum = minutes + sum;
array[I] = sum;
}
return 0;
}
Ok so I just add another loop inside the loop
To fix problem above now, but still can't figure out
How to find SD and printf when there are multiple
Maximum values
Full code : https://pastebin.pl/view/de043497