Pagini recente » Cod sursa (job #2729240) | Cod sursa (job #273999) | Cod sursa (job #1705500) | Cod sursa (job #2651480) | Cod sursa (job #2243302)
#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=false;
int karak=0;
int szodb=0;
while(f>>s)
{
found=false;
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;
}