Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include<conio.h>
  3. using namespace std;
  4. void wypelnij(int t[], int k)
  5. {
  6. for(int i=0;i<k;i++)
  7. {
  8. cout<<"Podaj liczby do tablicy o indeksie " <<i <<endl;
  9. cin>>t[i];
  10. }
  11. }
  12. void wypisz(int t[], int k)
  13. {
  14.  
  15. cout<<"[";
  16. for(int i=0;i<k;i++)
  17. {
  18. cout <<t[i] <<";" ;
  19. }
  20. cout<<"]";
  21. }
  22. int main()
  23. {
  24. int n;
  25. cout<<"Ile elementów ma mieć podana funkcja" <<endl;
  26. cin>>n;
  27. int tab1[n];
  28. wypelnij(tab1,n);
  29. wypisz(tab1,n);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement