You are viewing a single comment's thread. Return to all comments →
in c++
int main() { int N; cin >> N;
double nP = 0.0, nN = 0.0, nZ = 0.0; int index = 0, num = 0; while (index++ < N && cin >> num) { nP += (num > 0); nN += (num < 0); nZ += (num == 0); } printf("%.3f\n", nP/N); printf("%.3f\n", nN/N); printf("%.3f", nZ/N); return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
in c++
int main() { int N; cin >> N;
}