Cod sursa(job #1297391)
Utilizator | Data | 21 decembrie 2014 22:53:17 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <iostream>
#include <fstream>
using namespace std;
char c;
int main()
{
ifstream g("text.in");
ofstream f("text.out");
int nrc=0,nrcuv=0,ok=0;
while(!(g.eof()))
{
g.get(c);
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{
nrc++;
ok=1;
}
else if(ok==1)
{
nrcuv++;
ok=0;
}
}
f<<nrc/nrcuv;
}