Cod sursa(job #3240891)
Utilizator | Data | 22 august 2024 18:14:32 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int l,nr,ok;
char s;
int main()
{
ios_base::sync_with_stdio(false);
fin.tie(NULL);
l=0;
nr=0;
ok=0;
while(fin.get(s))
{
if(isalpha(s))
{
l++;
ok=1;
}
else
{
if(ok)
{
nr++;
ok=0;
}
}
}
fout<< l/nr;
return 0;
}