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