Cod sursa(job #2095024)
Utilizator | Data | 26 decembrie 2017 20:23:28 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#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;
}