Cod sursa(job #1133624)
Utilizator | Data | 5 martie 2014 10:43:56 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.53 kb |
#include<fstream>
using std::ofstream;
using std::ifstream;
int main()
{
char ch;
int nrc=0,nrl=0,incuvant=0;
ifstream fin("text.in");
ofstream fout("text.out");
while(fin.get(ch))
{
if(ch>='a' && ch<='z' || ch>='A' && ch<='Z')
{
nrl++;
incuvant=1;
}
else
if(incuvant)
{
incuvant =0;
nrc++;
}
}
fout<<nrl/nrc;
fin.close();
fout.close();
return 0;
}