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