fork download
  1. #include<iostream>
  2. #include<cstdlib>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7. int min;
  8. int a[8]={1,0,3,0,3,6,7,2};
  9. for(int k=0;k<8;k++){
  10. if (a[k]>0)
  11. min=a[k];
  12. for(int j=k+1;j<8;j++){
  13. if(a[j]<min&&a[j]!=0)
  14. min=a[j];
  15. else
  16. break;
  17. }
  18. }
  19. cout<<min<<endl;
  20. return 0;
  21.  
  22. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
2