TOPIC
Wrong 100%
andrade.lemos asked 1 year ago
Funciona no compilador e aqui não
/**
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
***/
include
int main() {
int i; float num,somaPos,contpos,mediaPos;
for(i=0;i<6;i++){ scanf("%f", &num); if(num>0){ contpos++; somaPos=somaPos+num; } } mediaPos=somaPos/contpos; printf("%.0f valores positivos\n", contpos); printf("%.1f\n", mediaPos); return 0; }