intmain(){ int N ; cin >> N ; float sum = 0 ; int Count = 0 ; for(int i = 0 ; i <N ; i++) { string s; cin >>s ; if(!isdigital(s)) cout <<"ERROR: "<<s<<" is not a legal number" <<endl ; else { sum += atof(s.c_str()); Count++ ; } } if(Count>1) printf("The average of %d numbers is %.2f\n" , Count,sum/Count) ; elseif(Count==1) printf("The average of 1 number is %.2f\n" , Count,sum) ; else printf("The average of 0 numbers is Undefined\n"); //cout <<"The average of "<<Count<<" numbers is "<<sum<< endl ;