Pagini recente » Cod sursa (job #2492250) | Borderou de evaluare (job #717703) | Cod sursa (job #806231)
Cod sursa(job #806231)
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream in("text.in"); ofstream out("text.out");
char text[2000000];
int l = 0, cuv = 0, i;
in.get(text, 2000000);
for (i=0;i<strlen(text);i++)
if ((text[i] >= 'A' && text[i] <= 'Z') || (text[i] >= 'a' && text[i] <= 'z'))
{
l++;
if (i && (text[i-1] < 'A' || text[i-1] > 'Z') && (text[i-1] < 'a' || text[i-1] > 'z'))
cuv++;
}
out<<l/cuv;
}