Cod sursa(job #655439)
Utilizator | Data | 2 ianuarie 2012 16:31:07 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char a,b;
long long n,i,nrl,nrc;
bool z;
int main() {
while (f.get(a)) {
if ((a>=65&&a<=90)||(a>=97&&a<=122)) {
nrl++;
z=1;
}
else if (z==1) {
z=0;
nrc++;
}
b=a;
}
if ((b>='a'&&b<='z')||(b>='A'&&b<='Z')) nrc++;
g<<nrl/nrc;
}