Pagini recente » Cod sursa (job #892973) | Cod sursa (job #2303916) | Cod sursa (job #2673245) | Cod sursa (job #2647116) | Cod sursa (job #2095058)
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
ifstream is("text.in");
ofstream os("text.out");
int suma_litere = 0;
string str;
int main()
{
int i = 0;
while(is >> str)
{
int aux = suma_litere;
for(int j = 0; j <= str.length(); ++j)
{
if(isalpha(str[j]))
suma_litere++;
if(isalpha(str[j-1]) && !isalpha(str[j]))
i++;
}
}
cout << suma_litere << ' ' << i;
os << suma_litere / i;
is.close();
os.close();
return 0;
}