Cod sursa(job #1295515)

Utilizator TosuAndreiTosu Andrei TosuAndrei Data 19 decembrie 2014 18:15:53
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.55 kb
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;

int main()
{   char a[300000],b[100]="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
    ifstream f("text.in");
    ofstream g("text.out");long int k=0,l=0;int ok=0;int i=0;
    f.getline(a,300000);
     while(a[i]!=NULL)
    {
        if(strchr(b,a[i]))
        {
            k++;
            if(ok==0)
            {
                l++;ok=1;
            }
        }
        else
            ok=0;i++;
    }
     k=k/l;
     g<<k;
    return 0;
}