Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int a[99999];
- int i=0;
- int x=999;
- int y;
- int h=-999;
- int k;
- do {
- cin>>a[i];
- i++;
- } while(a[i-1]!=0);
- i=0;
- while(a[i]!=0) {
- if(a[i]<x) {
- x=a[i];
- y = i;
- }
- if(a[i]>=h) {
- h=a[i];
- k = i;
- }
- i++;
- }
- cout<<x<<endl;
- cout<<y+1<<endl;
- cout<<h<<endl;
- cout<<k+1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement