Cod sursa(job #1377225)
Utilizator | Data | 5 martie 2015 20:48:37 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <fstream>
using namespace std;
ifstream in( "text.in" ) ;
ofstream out ( "text.out" ) ;
int main()
{
char c ;
int nr = 0 , a = 0 , b = 0 ;
while( in.get ( c ) )
{
if( ( c >= 'a'&& c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) )
{
a ++ ;
b ++ ;
}
else
if ( b > 0 )
{
nr ++ ;
b = 0 ;
}
}
out << a / nr ;
return 0;
}