Created
January 18, 2015 16:10
-
-
Save joffilyfe/85a0dc91358736850a8a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) { | |
int sum, input, i; | |
sum = 0; | |
i = 0; | |
do { | |
scanf("%d", &input); | |
if (input > 0) { | |
sum += input; | |
i++; | |
} | |
} while (input > 0); | |
printf("%.2f\n", (float)sum / i); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment