Cod sursa(job #2078099)
| Utilizator | Data | 28 noiembrie 2017 21:58:15 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int length=0, words=0;
char c, anterior;
while(fin.get(c))
{
if((anterior>='a'&&anterior<='z')||(anterior>='A'&&anterior<='Z'))
if((c<'a'||c>'z')&&(c<'A'||c>'Z'))
words++;
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
length++;
anterior=c;
}
fout << length/words;
return 0;
}
