Cod sursa(job #2072550)
Utilizator | Data | 21 noiembrie 2017 22:28:20 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char c;
int cnt,ok,nr=0;
int main()
{
while(f.get(c))
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{
nr++;
ok=1;
}
else
if(ok)
cnt++,ok=0;
if(cnt==0)
{
g<<0;
return 0;
}
g<<nr/cnt;
}