Pagini recente » Cod sursa (job #1578606) | Cod sursa (job #1638627) | Cod sursa (job #1217336) | Cod sursa (job #292773) | Cod sursa (job #1022205)
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
using namespace std;
char chars[1024*5];
int main()
{
float cuv=0;
float size=0;
fstream fin("text.in",ios::in);
fstream fout("text.out",ios::out);
while (fin>>chars)
{
cuv++;
// size+=strlen(chars);
// cout << (char) tolower(chars[0])<<" ";
for (int i=0;i<strlen(chars);i++)
{
// cout << (char) tolower(chars[i]);
if (tolower(chars[i])>=97&&tolower(chars[i])<=122)
{
size++;
}
}
}
fout << size/cuv;
}