Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int sum = 0, cnt = 0;
- for (int i = 0, a; i < 10; i++) {
- scanf("%d", &a);
- if (a > 0) {
- sum += a;
- cnt++;
- }
- }
- printf("%.10f\n", (double)sum / cnt);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement