Cod sursa(job #1231938)

Utilizator AcuasPopescu Nicolae-Aurelian Acuas Data 21 septembrie 2014 19:06:57
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.64 kb
#include <iostream>
#include <fstream>
#include <cstring>
#include <cctype>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char a[100100],v[40000],*p;
int i,k,s;
int main()
{
    f.getline(a,100000);
    for(i=0;i<strlen(a);i++)
        {
            if(isalpha(a[i])){
                while(isalpha(a[i]))
            {
                i++;
                s++;
            }
            i--;
            }
            else
            {
             k++;
             while(!isalpha(a[i]))
                    i++;
             i--;
            }
        }
    g<<s/(k-1)<<endl;
    return 0;
}