Pagini recente » Borderou de evaluare (job #2632132) | Borderou de evaluare (job #2547454) | Cod sursa (job #2177354) | Cod sursa (job #2173149)
#include <bits/stdc++.h>
#include <cassert>
using namespace std;
fstream f("text.in", ios::in);
fstream g("text.out", ios::out);
int main(void)
{
uint16_t wcount = 0, wlett = 0;
string text, buf;
assert(getline(f, text));
stringstream ss(text);
while(ss >> buf)
{
wcount++;
for(int i = 0; i < buf.length(); i++)
if(isalpha(buf[i])) wlett++;
}
assert(g << (uint16_t) wlett / wcount);
return EXIT_SUCCESS;
}