#include<bits/stdc++.h>
using namespace std;
int main(){
int a[10];
for (int i = 0;i <= 9;i++) cin >> a[i];
sort(a, a + 10);
reverse(a, a + 10);
for (int i = 0;i <= 9;i++) cout << a[i] << " ";
return 0;
}
Because making vector is not easy for newbie, so I'll give some program to you guys:
sort(a, a + 10); A array can also sort but not using vector than hard; reverse(a, a + 10); An array can also reverse and not using a vector to carry all the numbers.
So I will give the hole program to you guys but make sure you guys see all the words upside ok?
JUST PULL THE THING IN THE RIGHT FOR FASTER LOOKING AT THE PROGRAM.
ez :)
E01
#include<bits/stdc++.h>
using namespace std;
int main(){
int a[10];
for (int i = 0;i <= 9;i++) cin >> a[i];
sort(a, a + 10);
reverse(a, a + 10);
for (int i = 0;i <= 9;i++) cout << a[i] << " ";
return 0;
}