fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.  
  6. int N = 5;
  7. int arr[5] = {3, 5, 8, 15, 19};
  8. int x = 18;
  9. int i = 0;
  10.  
  11. while(i < N){
  12. if(arr[i] > x){
  13. cout<<arr[i];
  14. break;
  15. }
  16. i++;
  17. }
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
19