Cod sursa(job #674899)

Utilizator dutzulBodnariuc Dan Alexandru dutzul Data 6 februarie 2012 21:11:55
Problema Litere Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include <fstream>
#define L 10000
using namespace std;
ifstream f("litere.in");
ofstream g("litere.out");
int  i,n,fr[L],r,j;
char x;
int main()
{

for(i=1,f>>n;i<=n;++i)
{
    f>>x,fr[x-97]++;
    for(j=x-96;j<=100;++j) r+=fr[j];
}

g<<r;

f.close();
g.close();
    return 0;
}