Cod sursa(job #1710437)
Utilizator | Data | 28 mai 2016 22:39:11 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <fstream>
using namespace std;
bool eLitera(char c) {
return ((c>='a'&&c<='z')||(c>='A'&&c<='Z'));
}
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
char preced='*',curent;
int l=0,n=0;
while(fin>>noskipws>>curent) {
if(eLitera(curent))
l++;
else if(eLitera(preced))
n++;
preced=curent;
}
fout<<l/n;
return 0;
}