Cod sursa(job #2221413)
Utilizator | Data | 14 iulie 2018 08:47:48 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char c;
int N, i;
long long litere, cuvinte;
bool ok=false;
int main()
{
while(f.get(c))
{
if(isalpha(c))
{
litere++;
ok=true;
}
else if(ok==true)
{
cuvinte++;
ok=false;
}
}
g<<(long long) litere/cuvinte<<'\n';
return 0;
}