Cod sursa(job #904787)
Utilizator | Cobuz Andrei classius | Data | 4 martie 2013 20:50:42 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
//#include "stdafx.h"
#include <fstream>
#include <string>
#include <stdio.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char a;
int nrc=0,nrl=0,ok=0;
while(f.get(a))
{
if((a>='a'&&a<='z')||(a>='A'&&a<='Z'))
{
nrl++;
if(ok==0) ok=1;
}
else
{
if(ok==1)
{
nrc++;
ok=0;
}
}
}
if((a>='a'&&a<='z')||(a>='A'&&a<='Z'))
{
nrc++;
nrl--;
}
g<<nrl/nrc;
return 0;
}