Pagini recente » Cod sursa (job #851522) | Cod sursa (job #2855342) | Cod sursa (job #723617) | Cod sursa (job #2226702) | Cod sursa (job #1084233)
#include <fstream>
#include <string>
using namespace std;
ifstream is ("text.in");
ofstream os ("text.out");
int Lit (char x);
int main()
{
int l = 0, cuv = 0;
string s;
char x[] = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
getline(is, s, (char)EOF);
size_t t = s.find_first_of (x);
size_t q;
while (t != string::npos)
{
q = s.find_first_not_of(x, t);
l += q-t;
cuv++;
t = s.find_first_of(x, q);
}
os << l/cuv;
return 0;
}