Cod sursa(job #1587469)
Utilizator | Data | 2 februarie 2016 08:27:07 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char a;
int lit,cuv;
bool OK;
int main()
{
while(!(f.eof()))
{
f.get(a);
if((a>='A' && a<='Z') || (a>='a' && a<='z'))
{
lit++;
OK=true;
}
else if(OK)
{
cuv++;
OK=false;
}
}
g<<lit/cuv;
}