Cod sursa(job #2189367)
Utilizator | Data | 28 martie 2018 08:45:15 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s;
int i,n,nrcif,cuv;
int main()
{
while(f.get(s))
{
if(s>='a' && s<='z' or s>='A' && s<='Z')
{
nrcif++;
n++;
}
else if(nrcif>0)
{
nrcif=0;
cuv++;
}
}
if(nrcif>0)
{
cuv++;
}
g<<n/cuv<<'\n';
return 0;
}