Cod sursa(job #1585593)
Utilizator | Data | 31 ianuarie 2016 11:41:42 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int s,z,nr,a,ok;
char c;
int main()
{ s=0;
while (f.get(c)) {
if((c>='A'&&c<='Z')||(c>='a'&&c<='z')) {
++nr;
ok=1;}
else
if (ok!=0) {++z;
ok=0;}
}
if (ok!=0) ++z;
if (z!=0) g<<nr/z<<'\n';
else g<<0;
return 0;
}