Pagini recente » Cod sursa (job #1670615) | Cod sursa (job #2063661) | Cod sursa (job #97449) | Cod sursa (job #671255) | Cod sursa (job #1621541)
#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;
}