Cod sursa(job #1531000)
Utilizator | Data | 21 noiembrie 2015 13:11:15 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.53 kb |
#include<fstream>
#include<cstring>
#include<string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
int a,nrc=0,nrl=0,i,ok=0;
char s[513];
f.get(s,sizeof(s));
for(i=1;i<=strlen(s);i++)
{
a=(int)s[i];
if((a>=65 && a<=90)||(a>=97 && a<=122))
{
nrl++;
if(ok==0)
{
nrc++;
ok=1;
}
}
else
ok=0;
}
g<<nrl/nrc;
return 0;
}