Pagini recente » Cod sursa (job #1126062) | Cod sursa (job #1919053) | Cod sursa (job #2701594) | Cod sursa (job #1084363) | Cod sursa (job #2466695)
#include <bits/stdc++.h>
using namespace std;
int Litera(char ch)
{
if((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
{
return 1;
}
return 0;
}
int main(){
ifstream fin("text.in");
long long cuvinte=0,litere=0;
string x;
bool z;
while(fin>>x){
z=false;
for(auto i : x){
if(Litera(i))
{
litere++;
z=true;
}
else{
cuvinte++;
continue;
}
}
if(z)
cuvinte++;
}
ofstream fout("text.out");
fout << litere/cuvinte;
return 0;
}