Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include "stdio.h"
  2. #include "iostream"
  3. #include "math.h"
  4. #include <stdlib.h>
  5. #include<bits/stdc++.h>
  6. int main() {
  7.   int b=0,k=0,index=0,n=0;
  8.   scanf("%d\n", &b);
  9.   k=INT_MAX;
  10.   for (int i=1;i<11;i++){
  11.     scanf("%d", &n);
  12.     if((n>b)&&(n<k)){
  13.       k=n;
  14.       index=i;
  15.     }
  16.   }
  17. if(k==INT_MAX){
  18.   printf("%d %d",0,0);
  19. }
  20. else{
  21. printf("%d %d",k,index);}
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement