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