Pagini recente » Clasamentul arhivei de probleme | Cod sursa (job #3131203) | Cod sursa (job #2412558) | Clasamentul arhivei de probleme | Cod sursa (job #2095023)
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
ifstream is("text.in");
ofstream os("text.out");
int suma_litere;
string str;
int main()
{
int i = 0;
while(is >> str)
{
for(int j = 0; j < str.length(); ++j)
{
if(isalpha(str[j]))
suma_litere++;
}
i++;
}
os << suma_litere / i;
is.close();
os.close();
return 0;
}