Cod sursa(job #2312043)
| Utilizator | Data | 4 ianuarie 2019 00:47:56 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f ("text.in") ;
ofstream g ("text.out");
char x;
long long NrCuv = 0 , NrChr = 0;
bool haveWord;
int main()
{
haveWord = false;
while (f >> noskipws >> x)
{
if (isalpha(x))
{
NrChr ++ ;
if (!haveWord) haveWord = true;
}
else{
if (haveWord) {
haveWord = false;
NrCuv ++ ;
}
}
}
g << (long long) (NrChr / NrCuv) ;
f.close() ;
g.close();
return 0 ;
}
