Cod sursa(job #1914353)

Utilizator mihai2003LLL LLL mihai2003 Data 8 martie 2017 16:34:50
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <bits/stdc++.h>
using namespace std;
string s;
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    getline(cin,s);
    int l=s.size(),c=0,nrc=0;
    s.insert(s.begin(),' ');
    s.push_back(' ');
    for(int i=0;i<l;i++){
        if(isalpha(s[i])){
            if(!isalpha(s[i+1])){
                nrc++;
                //printf("%c %c %c\n",s[i],s[i+1],s[i-1]);
            }
           c++;
        }
    }
    printf("%d",c/nrc);
    //cout<<s;
    return 0;
}