Cod sursa(job #919143)
Utilizator | Data | 19 martie 2013 13:51:05 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <fstream> using namespace std; char c; int nc,nrc,valc=1; int main() { ifstream f1("text.in"); ofstream f2("text.out"); while (!f1.eof()) { f1.get(c); if (((c>96)&&(c<123))||((c>64)&&(c<91))) { ++nc; if (valc) { ++nrc; valc=0; } } else { if (!valc) valc=1; } } f2<<nc/nrc; return 0; }