Cod sursa(job #672316)
| Utilizator | Data | 1 februarie 2012 20:54:19 | |
|---|---|---|---|
| Problema | Text | Scor | 60 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
int main()
{
char c;
long litere=0,cuvinte=0,ok=1;
ifstream f("text.in");
c=f.get();
while(c!=EOF)
{
if((c>='a' && c<='z') || (c<='A' && c>='Z'))
{
litere++;
ok=0;
}
else ok++;
if(ok==1)
cuvinte++;
c=f.get();
}
ofstream g("text.out");
g<<litere/cuvinte;
return 0;
}
