Cod sursa(job #1880821)
Utilizator | Data | 15 februarie 2017 22:22:21 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int a=0,b=0,c=0;
string s;
getline(fin,s);
for (int i=0;i<s.size();i++)
{
if (isalpha(s[i])) {a++;} else {if (a>0) {b+=a; a=0; c++;}; };
}
fout<<b/c;
return 0;
}