Cod sursa(job #2326789)
Utilizator | Data | 23 ianuarie 2019 23:26:49 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in") ;
ofstream fout("text.out") ;
int main()
{
int sol = 0 , ct=0 , nr=0 ;
char ch;
while ( fin.get(ch) )
{
if ( (ch >= 'a' && ch <= 'z' )||(ch >= 'A' && ch <= 'Z' ) )
{
ct++ ;
if ( ct == 1 )
nr++ ;
}
else
{
sol = sol + ct ;
ct = 0 ;
}
}
fout << sol/nr ;
}