Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main() {
- double a[6], s = 0;
- int c = 0;
- for(int i = 0; i < 6; i++){
- cin >> a[i];
- if(a[i] > 0){
- c++;
- s += a[i];
- }
- }
- cout << c << " valores positivos\n";
- cout << fixed << setprecision(1) << s/c << "\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement