Pagini recente » Cod sursa (job #1052978) | Cod sursa (job #2267109) | Diferente pentru utilizator/loo_k01 intre reviziile 52 si 53 | Cod sursa (job #2969383) | Cod sursa (job #1028257)
#include <iostream>
#include <fstream>
#include<string.h>
using namespace std;
int main()
{
ifstream f1("text.in");
int i=0,s=0;
char ch;
while(!f1.eof())
{
f1.get(ch);
if( ((ch >= 'a' ) && (ch <= 'z' )) || ((ch >= 'A' ) && (ch <= 'Z')))
i++;
if( ch == ' ')
s++;
if( ch == '-')
s++;
}
ofstream f2("text.out");
f2<<i/s;
}