Cod sursa(job #1113575)
| Utilizator | Data | 20 februarie 2014 18:35:54 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.62 kb |
#include <fstream>
using namespace std;
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
char c;
long cuvinte, lit;
bool sfCuv;
cuvinte = 0;
lit = 0;
sfCuv = 0;
while(! fin.eof())
{
fin.get(c);
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
{
++lit;
if(sfCuv == 0)
{
++cuvinte;
sfCuv = 1;
}
}
else
sfCuv = 0;
}
fout << lit / cuvinte;
fin.close();
fout.close();
return 0;
}
