You are on page 1of 1

3.

#include <iostream>

#include <fstream>

using namespace std;

int main()

int n,a[100],b[100],i,j,aux;

ifstream f("numere.in");

ofstream g("numere.out");

f>>n;

for(i=0;i<n;i++)

f>>a[i];

for(i=0;i<n;i++)

aux=0;

for(j=0;j<n;j++)

if(a[i]>a[j])

aux++;

b[i]=aux;

for(i=0;i<n;i++)

cout<<b[i]<<" ";

f.close();

g.close();

return 0;

You might also like