Advertisement
olaaa

Untitled

Nov 7th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <cmath>
  5. using namespace std;
  6.  
  7. int zamien(int tab[], bool y=false) {
  8. static int wywolania;
  9. for (int i = 0; i < 10; i++) {
  10. if (i < 0) {
  11. abs(i);
  12. return abs(i);
  13. }
  14. else {
  15. return i;
  16. }
  17. wywolania++;
  18. }
  19. }
  20.  
  21. int main()
  22. {
  23.  
  24.  
  25. int tab[10];
  26. cout << "Podaj 10 liczb calkowitych";
  27. zamien(tab, false); {
  28. cin >> tab[0];
  29. cin >> tab[1];
  30. cin >> tab[2];
  31. cin >> tab[3];
  32. cin >> tab[4];
  33. cin >> tab[5];
  34. cin >> tab[6];
  35. cin >> tab[7];
  36. cin >> tab[8];
  37. cin >> tab[9];
  38.  
  39. cout << tab[0] << endl; cout << tab[1] << endl; cout << tab[2] << endl;
  40. cout << tab[3] << endl; cout << tab[4] << endl;
  41. cout << tab[5] << endl; cout << tab[6] << endl; cout << tab[7] << endl;
  42. cout << tab[8] << endl; cout << tab[9] << endl; }
  43.  
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement