Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <time.h>
- #include <stdlib.h>
- using namespace std;
- void SpausdintiRezultatus(int zzz, int xxx[10000])
- {
- for(int s=0; s<zzz; s++)
- cout<<xxx[s]<<endl;
- }
- void SurikiuotiElementus(int zz, int xx[10000])
- {
- int buf;
- for(int j=0;j<zz;j++){
- for(int i=0;i<zz-1;i++){
- if(xx[i]<xx[i+1]){
- buf=xx[i];
- xx[i]=xx[i+1];
- xx[i+1]=buf;
- }
- }
- }
- SpausdintiRezultatus(zz,xx);
- }
- void NuskaitytiSeka()
- {
- int z, x[10000];;
- cin>>z;
- for(int i=0; i<z; i++)
- {
- cin>>x[i];
- }
- SurikiuotiElementus(z,x);
- }
- void main()
- {
- NuskaitytiSeka();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement