Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin>>n;
- float min1=1000001, max2=0;
- int ans=0;
- float a;
- for(int i=0;i<n;i++){
- cin>>a;
- if(a<1){
- if(a>max2){
- max2=a;
- }
- }
- else{
- ans++;
- if(a<min1){
- min1=a;
- }
- }
- }
- if(ans==0){
- cout<<"1 "<<max2;
- }
- else{
- cout<<ans<<' '<<min1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement