Pagini recente » Cod sursa (job #95021) | Cod sursa (job #1730090) | Monitorul de evaluare | Cod sursa (job #2497594) | Cod sursa (job #1557472)
#include <iostream>
#include <fstream>
using namespace std;
int x=0,y=0,n,i;
string s;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{
getline(f,s);
n=s.size();
for(i=0;i<n;i++)
{
if((s[i]>='A' and s[i]<='Z')or (s[i]>='a' and s[i]<='z'))
x++;
else
{
while(!((s[i]>='A' and s[i]<='Z')or (s[i]>='a' and s[i]<='z')))
i++;
i--;
y++;
}
}
s.erase(0,n-1);
}
g<<x/y;
return 0;
}