Курсовая работа: Особливості мови програмування С
void print (int* mas, int n)
{
for (int i=0; i<n; i++)
cout<<mas[i]<<" ";
cout<<endl;
}
void print (char** mas, int n)
{
for (int i=0; i<n; i++)
cout<<mas[i]<<" ";
cout<<endl;}
void print (database* mas, int n)
{
for (int i=0; i<n; i++)
cout<<mas[i].name<<" "<<mas[i].age<<endl;
}
const n=10, m=5;
int mas[n]={1,5,2,6,3,7,12,-1,6,-3};
char* strmas[n]={"adg","dfgj","jk","asg","gjh",
"sdh","hj","sd","kfj","sdadgh"};
database d[m] ={{"Petrov",32},{"Ivanov",24},
{"Kozlov",21},{"Oslov",20},
{"Popov",18}};
void main()
{
ssort(mas,n,sizeof(int),less_int);
print(mas,n);
ssort(mas,n,sizeof(int),greater_int);
print(mas,n);