#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int temp[100];
int m,n,i;
cout<<"Total number : ";
cin>>n;
cout<<"Maximum number : ";
cin>>m;
int c[m+1];
memset(c, 0, sizeof c);
for(i=0;i<n;i++){
cin>>temp[i];
int a=temp[i];
c[a]++;
}
for(i=1;i<=m;i++)
c[i]=c[i]+c[i-1];
int arry[n];
for(i=0;i<n;i++){
int b=temp[i];
arry[c[b]-1]=b;
c[b]--;
}
for(i=0;i<n;i++){
cout<<arry[i]<<" ";
}
cout<<endl;
return 0;
}
If you're trying hard to lose weight then you absolutely need to start following this totally brand new custom keto meal plan.
ReplyDeleteTo create this service, certified nutritionists, personal trainers, and cooks joined together to develop keto meal plans that are powerful, painless, cost-efficient, and satisfying.
From their grand opening in January 2019, hundreds of individuals have already completely transformed their body and well-being with the benefits a good keto meal plan can provide.
Speaking of benefits: in this link, you'll discover 8 scientifically-confirmed ones offered by the keto meal plan.