Cod sursa(job #1034312)
| Utilizator | Data | 17 noiembrie 2013 19:22:12 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char ch;
int lc=0,nc=0,ok=0;
ch=f.get();
while (!f.eof())
{
if (isalpha(ch))
{
lc++;
ok=0;
}
else ok++;
if (ok==1 && lc)
nc++;
ch=f.get();
}
g<<lc/nc;
return 0;
}
