Cod sursa(job #2072547)
Utilizator | Data | 21 noiembrie 2017 22:26:48 | |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 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;
}