Cod sursa(job #2192345)
Utilizator | Mihai Lazar Mihai77 | Data | 5 aprilie 2018 18:03:16 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s;
long long l,d,i,ok=0;
int main()
{
while(fin.get(s))
{
if(s>='a' && s<='z' || s>='A' && s<='Z')
{
l++;
ok=1;
}
else if(ok)
{
d++;
ok=0;
}
}
if(ok)
d++;
fout<<l/d;
return 0;
}