Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main(){
- // ifstream cin("test.in");
- // ofstream cout("test.out");
- int n,a[10]={},nr,maxx=0;
- cin>>n;
- for(int i=1; i<=n; i++){
- cin>>nr;
- if(nr>maxx){
- maxx=nr;
- }
- if(nr<10){
- a[nr]++;
- }
- }
- cout<<maxx<<endl;
- for(int i=1; i<=9; i=i+2){
- ///if(i%2==1)
- for(int j=1; j<=a[i]; j++){
- cout<< i<< " ";
- }
- }
- }
- /*
- 8
- 102 3 7 2 23 5 10001 5
- 2 3 5 5 7
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement