Cod sursa(job #708644)
Utilizator | Data | 7 martie 2012 00:18:30 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<fstream>
#include <locale>
using namespace std;
int main()
{
ifstream in("text.in");
ofstream out("text.out");
int c,s=0,nrc=0;
bool cuv=false;
while(in.good())
{
c=in.get();
if(islower(c) || isupper(c))
{
if(!cuv)
{
cuv=true;
nrc++;
}
s++;
}
else
{
cuv=false;
}
}
out<<s/nrc;
return 0;
}