Cod sursa(job #1361406)
| Utilizator | Data | 25 februarie 2015 21:03:46 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.57 kb |
#include <fstream>
#include <iostream>
#include <string.h>
using namespace std;
ifstream in ("text.in");
ofstream out ("text.out");
char text;
bool cuvant=false;
int lungime,nr_cuvinte;
int main()
{
while (!in.eof())
{
in>>noskipws>>text;
if ((text>='a'&&text<='z')||(text>='A'&&text<='Z'))
{
lungime++;
if (cuvant==false)
{
nr_cuvinte++;
cuvant=true;
}
}
else cuvant = false;
}
out<<lungime/nr_cuvinte;
return 0;
}
