Cod sursa(job #2013708)

Utilizator stefdascalescuStefan Dascalescu stefdascalescu Data 22 august 2017 10:33:00
Problema Litere Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include<bits/stdc++.h>
using namespace std;
ifstream f("litere.in");
ofstream g("litere.out");
int n,sol;
char c[10002];
int main()
{
    f>>n;
    f>>c;
    for(int i=1;i<n;++i)
        for(int j=0;j<i;++j)
            if(c[i]<c[j])
                ++sol;
    g<<sol;
    return 0;
}