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