Cod sursa(job #1813220)
| Utilizator | Data | 22 noiembrie 2016 20:05:22 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.63 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
inline bool Litera(char ch)
{
if ('a'<=ch && ch<='z') return true;
if ('A'<=ch && ch<='Z') return true;
return false;
}
int main()
{
char ch;
int lgmax,nrcuv;
bool cuvant;
lgmax=nrcuv=0;
while(fin.get(ch))
{
if (Litera(ch))
{
lgmax++;
cuvant=true;
}
else
{
if (cuvant) nrcuv++;
cuvant=false;
}
}
fout<<lgmax/nrcuv<<"\n";
fin.close();
fout.close();
return 0;
}
