Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- #include "iostream"
- #include "math.h"
- #include <stdlib.h>
- #include<bits/stdc++.h>
- int main() {
- int b=0,k=0,index=0,n=0;
- scanf("%d\n", &b);
- k=INT_MAX;
- for (int i=1;i<11;i++){
- scanf("%d", &n);
- if((n>b)&&(n<k)){
- k=n;
- index=i;
- }
- }
- if(k==INT_MAX){
- printf("%d %d",0,0);
- }
- else{
- printf("%d %d",k,index);}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement