Cod sursa(job #1621541)
| Utilizator | Data | 29 februarie 2016 19:50:16 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
#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;
}
