image.png

    1. #include <iostream>
    2. using namespace std;
    3. int main(){
    4. int num = 0;
    5. int temp = 0;
    6. while(cin>>num)
    7. {
    8. int num_negetive = 0;
    9. int num_positive = 0;
    10. float ave_positive = 0.0;
    11. for(int i = 0;i<num;i++){
    12. cin>>temp;
    13. if(temp < 0){
    14. num_negetive++;
    15. }
    16. else if(temp > 0){
    17. num_positive++;
    18. ave_positive+=temp;
    19. }
    20. }
    21. printf("%d %.1f\n",num_negetive,ave_positive/num_positive);
    22. }
    23. }