Pagini recente » Cod sursa (job #443718) | Cod sursa (job #1266346) | Cod sursa (job #411637) | Cod sursa (job #3181560) | Cod sursa (job #2680806)
#include <fstream>
#include <iostream>
using namespace std;
long long c;
string s;
long long ltotal,nrcuv,lcuv;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
getline(fin, s);
for(string::iterator it = s.begin(); it != s.end(); it++){
c = *it;
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')){
ltotal++;
lcuv++;
cout << (char)c;
}else{
if(lcuv != 0){
nrcuv++;
cout << "\n";
}
lcuv = 0;
}
}
if(nrcuv == 0){
fout << "0\n";
return 0;
}
fout << ltotal/nrcuv << "\n";
return 0;
}