Pagini recente » Cod sursa (job #2596351) | Cod sursa (job #1588479) | Cod sursa (job #869343) | Cod sursa (job #2341175) | Cod sursa (job #999120)
Cod sursa(job #999120)
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
using namespace std;
char chars[1024];
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;
}