Cod sursa(job #1791644)
| Utilizator | Data | 29 octombrie 2016 16:18:07 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.58 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char c;
long long n,i;
int main()
{
long long suma=0;
long long nr=0;
int ok=0;
while(fin.get(c))
{
if((c>='a' && c<='z') || (c>='A' && c<='Z'))
{
++suma;
ok=1;
}
else
{
if(ok)
{
nr++;
ok=0;
}
}
}
if(nr!=0)
fout<<suma/nr;
else
fout<<0;
}
