Pagini recente » Cod sursa (job #2288934) | Cod sursa (job #1692335) | Cod sursa (job #1339313) | Cod sursa (job #1894684) | Cod sursa (job #1028848)
#include <iostream>
#include <fstream>
#include<string.h>
using namespace std;
int main()
{
ifstream f1("text.in");
int long i=0,s=1,ok=0;
char ch;
while(!f1.eof())
{
f1.get(ch);
while(((ch < 'a' ) && (ch > 'z' )) || ((ch < 'A' ) && (ch > 'Z')))
f1.get(ch);
if( ((ch >= 'a' ) && (ch <= 'z' )) || ((ch >= 'A' ) && (ch <= 'Z')))
i++;
if(ch==' ')
s++;
}
f1.open("text.in");
ofstream f2("text.out");
f2<<i/s;
}