Cod sursa(job #2311262)
| Utilizator | Data | 2 ianuarie 2019 20:29:56 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include<fstream>
#include<cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int cuv=0;
int lit=0;
string s;
bool cuva;
while(fin>>s)
{
cuva=true;
for(int i=0;i<s.length();i++)
{
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
{
lit++;
if(cuva) {cuv++; cuva=false;}
}
else cuva=true;
}
}
fout<<lit/cuv;
}
