Cod sursa(job #919146)
Utilizator | Data | 19 martie 2013 13:52:13 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.52 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;
}