Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #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++)
- {
- for(int i=0;i<tam;i++)
- {
- cout<<"insira valor vetor\n";
- cin>> vet[i];
- }
- }
- };
- void ImprimaVetor( ) {
- for(int i=0;i<tam;i++)
- {
- for(int i=0;i<tam;i++)
- {
- cout<<" "<<vet[i];
- }
- }
- cout<<"\n";
- };
- };
- int main(int argc, char *argv[])
- {
- Vetor V(1);
- V.LeiaVetor( );
- V.ImprimaVetor();
- }
Advertisement
Add Comment
Please, Sign In to add comment