Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int rozmiar=0,y;
  6. cout<<"ile liczb chcesz wpisac do tablicy - ";
  7. cin>>y;
  8.  
  9. while(y>0)
  10. {
  11. y--;
  12. rozmiar++;
  13. }
  14.  
  15. int x=0, tab[rozmiar];
  16.  
  17. for (int i=1;i<=rozmiar;i++)
  18. {
  19. cout<<"podaj "<<i<<" liczbe - ";
  20. cin>>tab[x];
  21. x++;
  22. }
  23.  
  24. for (int k=1;k<=rozmiar;k++)
  25. {
  26. x=0;
  27. cout<<k<<" element tablicy to - "<<tab[x]<<endl;
  28. x++;
  29. }
  30.  
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement