Cod sursa(job #1984625)
Utilizator | Data | 25 mai 2017 15:51:30 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char c;
int nrc,cuv,ok;
int main()
{
while(fin)
{
fin.get(c);
if((c>='a' && c<='z') || (c>='A' && c<='Z'))
{
if(!ok)
{
cuv++;
ok=1;
}
nrc++;
}else if(ok)ok=0;
}
if(!cuv)fout<<0;
else fout<<nrc/cuv;
return 0;
}