Cod sursa(job #179375)
| Utilizator | Data | 15 aprilie 2008 20:46:06 | |
|---|---|---|---|
| Problema | Litere | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <fstream.h>
#include <iostream.h>
#include <stdlib.h>
int c=0;
char N[10000];int y,n;
int verifica(int s)
{
for(int i=s;i<y-2;++i)
if(N[s]>=N[i]) ++c;
}
int main()
{
freopen("litere.in","r",stdin);
freopen("litere.out","w",stdout);
scanf("%d",&y);
scanf("%c",&n);
for(int i=0;i<y;++i)
scanf("%c",&N[i]);
for(int i=0;i<y-1;++i)
verifica(i);
//printf("%c",N[i]);
printf("%d",c);
return 0;
}
