Pagini recente » Profil usureluflorian | Diferente pentru preoni-2007/runda-2 intre reviziile 20 si 11 | Cod sursa (job #223860) | Profil Adriana_S | Cod sursa (job #2022686)
#include <fstream>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
bool f(char ch)
{
if('a'<=ch and ch<='z')
return 1;
if('A'<=ch and ch<='Z')
return 1;
return 0;
}
int main()
{
ios_base::sync_with_stdio(0);
long long sum=0,nr=0;
char ch;
while(1)
{
ch=cin.get();
if(ch=='\n')
{
cout<<sum/nr;
return 0;
}
if(f(ch))
{
nr++;
sum++;
while(1)
{
ch=cin.get();
if(ch=='\n')
{
cout<<sum/nr;
return 0;
}
if(f(ch)==0)
break;
sum++;
}
}
}
return 0;
}