Cod sursa(job #943437)
Utilizator | Data | 25 aprilie 2013 14:27:11 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <fstream>
using namespace std;
ifstream ka("text.in");
ofstream ki("text.out");
bool p=true;
long long cuv,lungime;
char a;
int main()
{
ka>>noskipws;
while(ka>>a)
{
if(('a'<=a&&a<='z')||('A'<=a&&a<='Z'))
{
if(p)
{cuv++;
p=false;}
lungime++;
}
else
{
p=true;
}
}
ki<<lungime/cuv;
}