Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. case 3:
  2. for(int i=0;i<10;i++){
  3. cin>>tab3[i];
  4. }
  5. if(tab3[0]==tab3[1] and tab3[1]==tab3[2] and tab3[2]==tab3[3] and tab3[3]==tab3[4] and tab3[4]==tab3[5] and tab3[5]==tab3[6] and tab3[6]==tab3[7] and tab3[7]==tab3[8] and tab3[8]==tab3[9]){
  6. cout<<"Not existing.";
  7. }
  8. else{
  9. if(tab3[0] < tab3[1]){
  10. min1=tab3[0];
  11. min2=tab3[1];
  12. } else{
  13. min1=tab3[1];
  14. min2=tab3[0];
  15. }
  16.  
  17. for(int i=0;i<10;i++){
  18. if(min1>tab3[i]){
  19. min2=min1;
  20. min1=tab3[1];
  21. } else if(min2>tab[i] and tab[i]!= min1){
  22. min2=tab[i];
  23. }
  24. } cout<<min2;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement