#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
void oneArray()
{
int size=rand()%10;
int* pint=new int[size];
for(int i=0;i<size;++i)
{
pint[i]=rand()%100;
}
cout<<"one array is "<<endl;
for(int i=0;i<size;++i)
{
cout<<pint[i]<<"\t";
}
cout<<endl;
delete []pint;
}
void twoArray()
{
int row=rand()%10;
int column=rand()%10;
cout<<"row is "<<row<<" column is "<<column<<endl;
cout<<"two array is"<<endl;
int** p=new int*[row];
for(int i=0;i<row;++i)
{
p[i]=new int[column];
}
for(int i=0;i<row;++i)
{
for(int j=0;j<column;++j)
{
p[i][j]=rand()%100;
}
}
for(int i=0;i<row;++i)
{
for(int j=0;j<column;++j)
{
cout<<p[i][j]<<"\t";
}
cout<<endl;
}
cout<<"delete array"<<endl;
for(int i=0;i<row;++i)
{
delete []p[i];
}
delete []p;
}
void threeArray()
{
cout<<"three array"<<endl;
int height=rand()%10;
int row=rand()%10;
int column=rand()%10;
cout<<"height is "<<height<<" row is "<<row<<" column is "<<column<<endl;
int*** p=new int**[height];
for(int i=0;i<height;i++)
{
p[i]=new int*[row];
}
for(int i=0;i<height;++i)
{
for(int j=0;j<row;++j)
{
p[i][j]=new int[column];
}
}
for(int i=0;i<height;++i)
for(int j=0;j<row;++j)
for(int k=0;k<column;++k)
{
p[i][j][k]=rand()%100;
}
for(int i=0;i<height;++i)
{
for(int j=0;j<row;++j)
{
for(int k=0;k<column;++k)
{
cout<<p[i][j][k]<<"\t";
}
cout<<endl;
}
cout<<endl<<endl;
}
cout<<"delete three array"<<endl;
for(int i=0;i<height;++i)
{
for(int j=0;j<row;++j)
{
delete []p[i][j];
}
}
for(int i=0;i<height;i++)
{
delete []p[i];
}
delete []p;
}
void main()
{
srand(unsigned(time(NULL)));
oneArray();
twoArray();
threeArray();
int aa;
cin>>aa;
}<代码收藏>动态生成数组
ACE-Step
音乐合成
ACE-Step
ACE-Step是由中国团队阶跃星辰(StepFun)与ACE Studio联手打造的开源音乐生成模型。 它拥有3.5B参数量,支持快速高质量生成、强可控性和易于拓展的特点。 最厉害的是,它可以生成多种语言的歌曲,包括但不限于中文、英文、日文等19种语言
您可能感兴趣的与本文相关的镜像
ACE-Step
音乐合成
ACE-Step
ACE-Step是由中国团队阶跃星辰(StepFun)与ACE Studio联手打造的开源音乐生成模型。 它拥有3.5B参数量,支持快速高质量生成、强可控性和易于拓展的特点。 最厉害的是,它可以生成多种语言的歌曲,包括但不限于中文、英文、日文等19种语言





