Cod sursa(job #1195545)
Utilizator | Kurt Godel Maarcell | Data | 7 iunie 2014 20:49:33 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <fstream>
using namespace std;
int i,l,k,j,lung,t,n;
bool isLitera(char a){
if (((a>='a') && (a<='z')) || ((a>='A') && (a<='Z'))) return true;
return false;
}
int main()
{
char c;
ifstream in("text.in");
ofstream out("text.out");
c=in.get();
while (!in.eof())
{
if (isLitera(c)) {t++; k=1;}
else if (k) {n++; k=0;}
c=in.get();
}
out << t/n;
return 0;
}