Advertisement
thinhckhcmus

nhập xuất mảng động

Oct 11th, 2019
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. void nhap(int *a, int &n)
  2. {
  3. cout<<"nhap so phan tu mang"<<endl;
  4. cin>>n;
  5. a=(int*)calloc(n,sizeof(int));
  6. for(int i=0;i<n;i++)
  7. {
  8. cout<<"a["<<i<<"]=";
  9. cin>>*(a+i);
  10. }
  11. }
  12. void hienmang(int *a, int n)
  13. {
  14. for(int i=0;i<n;i++)
  15. cout<<*(a+i);
  16. cout<<endl;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement