Pagini recente » Cod sursa (job #2745101) | Cod sursa (job #2367159) | Cod sursa (job #153785) | Cod sursa (job #994658) | Cod sursa (job #1621538)
#include <iostream>
#include <fstream>
using namespace std;
char x;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int cuvinte = 0, litere = 0;
while(!fin.eof()){
fin.get(x);
if((int)x >= 65 && (int)x <= 90 || (int)x >= 97 && (int)x <= 122) litere++;
else if((int)x == 32 || (int)x == 63 || (int)x == 33 || (int)x == 46)
cuvinte++;
}
//cout << litere <<" "<< cuvinte << " ";
fout << litere / cuvinte;
return 0;
}