Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include <iomanip>
- int main()
- {
- int count;
- std::cin>>count;
- count=abs(count);
- double* massive=new double[count];
- for (int index{1}; index<=count; ++index) {
- std::cin>>massive[index];
- }
- int times{0};
- double sum{0};
- for (int index{0}; index<count; ++index) {if(massive[index]<0){sum+=massive[index];++times;}}
- std::cout<<times<<" "<<std::setprecision(3)<<sum;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement