Cod sursa(job #151611)
Utilizator | Data | 8 martie 2008 14:16:02 | |
---|---|---|---|
Problema | Litere | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <stdio.h>
#define N 10128
char v[N];
int main()
{
int i,j,n,rez=0;
freopen("litere.in", "r",stdin);
freopen("litere.out", "w",stdout);
scanf("%d", &n);
for(i=0;i<=n;++i)
{
scanf("%c", &v[i]);
for(j=i;j>=0;--j)
if(v[j]>v[i])
rez++;
}
printf("%d\n", rez);
return 0;
}