Cod sursa(job #1082744)
Utilizator | Data | 14 ianuarie 2014 21:38:37 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream in("text.in");
ofstream out("text.out");
char val;
int cnt=0,length=0;
bool valid=0;
while(!in.eof())
{
in.get(val);
if((val>='a' && val<='z') || (val>='A' && val<='Z'))
{
if(valid==0)
{
cnt++;
valid=1;
}
length++;
}
else valid=0;
}
out<<length/cnt;
return 0;
}