Cod sursa(job #1555878)
Utilizator | Data | 23 decembrie 2015 17:45:37 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include<fstream>
#include<cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int n,c1,q1,ok;
char c[1000001];
int main()
{
f.get(c,1000000);
n=strlen(c);
int a=0;
while(a<n)
{
if(c[a]>='A' && c[a]<='Z' || c[a]>='a' && c[a]<='z')
{
++c1;
if(ok==0)
{
++q1;
ok=1;
}
}
else
ok=0;
++a;
}
g<<c1/q1<<'\n';
return 0;
}