Cod sursa(job #920467)

Utilizator baicuviorelBaicu Viorel baicuviorel Data 20 martie 2013 15:22:19
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <fstream>
#include <cstring>

using namespace std;
ifstream  in ("text.in");
ofstream  out ("text.out");
char s[]="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",c;
int main()
{
    int l=0,now=0,w=0,i=0;

    while(in.get(c))
    {
        i++;
        char *p;
        p=strchr(s,c);
       if(p)
       {
           if(now==0)
           {
               now=1;
               w++;
           }
           l++;
       }
       else
            now=0;
    }
    out<<l/w;
    return 0;
}