Cod sursa(job #672337)
Utilizator | Alexandru Coman AlexCom | Data | 1 februarie 2012 21:27:13 |
---|---|---|---|
Problema | Text | Scor | 100 |
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=10;
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;
}