Cod sursa(job #962049)
Utilizator | Data | 13 iunie 2013 18:24:49 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <fstream>
#include <string>
using namespace std;
int main()
{
int cuv=0,i,n,lit=0,k=0;
char x;
ifstream f("text.in");
while ( f.get(x) )
{if( (x>='a' && x<='z') || (x>='A' && x<='Z') )
{lit++;
k=1;}
else
if(k)
{k=0;
cuv++;}
}
f.close();
ofstream g("text.out");
g<<lit/cuv;
return 0;
}