Cod sursa(job #1599437)
Utilizator | Data | 13 februarie 2016 21:15:04 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <stdio.h>
#include <fstream>
using namespace std;
char s;
long long nr, t,l;
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
while (fin.get(s))
{
if (isalpha(s))
{
l++;
nr=1;
}
else if (nr==1)
{
t++;
nr=0;
}
}
if (isalpha(s)) t++;
fout<<l/t;
return 0;
}