Cod sursa(job #2393713)
Utilizator | Data | 31 martie 2019 21:54:53 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.54 kb |
#include<fstream>
#include<cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int nr=0;
int nr_cuv=0;
bool ok=0;
char x;
while(fin.get(x))
{
if(('a'<=x&&x<'z')||('A'<=x&&x<='Z'))
{
if(ok==0)
{
nr_cuv++;
ok=1;
}
nr++;
ok=1;
}
else
{
ok=0;
}
}
fout<<nr/nr_cuv;
fin.close();
fout.close();
return 0;
}