Pagini recente » Cod sursa (job #455277) | Cod sursa (job #2653777) | Cod sursa (job #2864793) | Cod sursa (job #507523) | Cod sursa (job #2243299)
#include <iostream>
#include <fstream>
#include <math.h>
#include <string>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
string s;
bool found;
int karak=0;
int szodb=0;
while(f>>s)
{
for(int i=0; i<=s.length()-1; i++)
{
if(isalpha(s[i]))
{
found=true;
karak++;
}
}
if(found) szodb++;
}
g<<karak/szodb<<endl;
return 0;
}