Cod sursa(job #1127911)
Utilizator | Data | 27 februarie 2014 14:18:21 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
using namespace std;
#include <fstream>
#include <string.h>
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int nrcuv=0, lg=0, ok=0;
char c;
while(fin>>noskipws >>c)
{
if((c>='a'&& c<='z') || (c>='A' && c<='Z'))
{lg++; ok=1;}
else if(ok) {nrcuv++; ok=0;}
}
if(ok) nrcuv++;
fout<<lg/nrcuv;
return 0;
}