Code

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

#include "stdio.h" #include <iostream> using namespace std; #include <time.h> #include <stdlib.h> #include <conio.

h> void inputarrray(int a[],int n){ int i; srand(time(NULL)); for (i=0;i<n;i++) a[i]=rand(); } void outputarray(int a[],int n){ int i; for (i=0;i<n;i++) cout<<a[i]<<" "; } void main(){ int a[100]; int n; cout<<"Nhap so phan tu: "; cin>>n; inputarrray(a,n); outputarray(a,n); getch(); }

3 3 3 3

3 3 3 3

3 3 3 3

3 3 3 3

4 4 4 4

4 4 4 4

4 4 4 4

4 4 4 4

int **pData; pData= new int[dang];

for(i-> dong) pData[i]=new int[cot];

for(i-> dong) delete[]pData[i]; delete []pData; pData=NULL;

You might also like