Mảng Tăng:
void nhap(int a[][max],int d,int c)
{
srand((unsigned) time(NULL));
int t=abs(rand()%100);
for(int i=0;i<d;i++)
for(int j=0;i<c;j++)
{
a[i][j]=t+abs(rand()%100);
t= a[i][j];
}
}
Mảng Giảm:
void nhap(int a[][max],int d,int c)
{
srand((unsigned) time(NULL));
int t=abs(rand()%100);
for(int i=d-1;i>=0;i--)
for(int j=c-1;i>=0;j--)
{
a[i][j]=t+abs(rand()%100);
t= a[i][j];
}
}
Friday, October 7, 2011
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment