Cod sursa(job #1509730)

Utilizator gabrielchisChis Gabriel gabrielchis Data 24 octombrie 2015 11:36:15
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <iostream>
#include <fstream>
using namespace std;
string s;
int n,i,l,c;
bool ok;
int main()
{
    ifstream f("text.in");
    ofstream g("text.out");
    while(!f.eof())
    {
    getline(f,s);
    n=s.size();
    for(i=0;i<=n-1;i++)
    {
        if (isalpha(s[i])) {l++; ok=true;}
        if (!isalpha(s[i+1])&& ok==true) {c++; ok=false;}
    }

    }g<<l/c;
    return 0;
}