Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Vetor
- {
- int *vet;
- int tam;
- public:
- Vetor(int n)
- {
- vet = new int [n];
- tam=n;
- };
- ~Vetor( )
- {
- delete []vet;
- };
- void LeiaVetor ( )
- {
- for(int i=0;i<tam;i++)
- {
- cout << "Vet" << "[" << i << "]:";
- cin >> vet[i];
- cout << "\n";
- }
- };
- void ImprimaVetor( )
- {
- for(int i=0;i<tam;i++)
- cout << "Vet" << "[" << i << "]:" << vet[i] << "\n";
- };
- };
- int main(void)
- {
- Vetor V(10);
- V.LeiaVetor( );
- V.ImprimaVetor();
- };
Advertisement
Add Comment
Please, Sign In to add comment