Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int liczby[ 50 ];
  10. int dlugosc;
  11. bool check;
  12. do
  13. {
  14. check = true;
  15. cout << "Podaj dlugosc ciagu liczb: ";
  16. cin >> dlugosc;
  17. if( dlugosc < 2 || dlugosc > 50 )
  18. check = false;
  19.  
  20. cin.clear();
  21. cin.sync();
  22. } while( check == false );
  23.  
  24. for( int i = 0; i < dlugosc; i++ )
  25. {
  26. cout << "Podaj element " << i + 1 << " : ";
  27. cin >> liczby[i];
  28.  
  29.  
  30.  
  31.  
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement