Cod sursa(job #1555882)
Utilizator | Data | 23 decembrie 2015 17:46:56 | |
---|---|---|---|
Problema | Text | Scor | 10 |
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[1234567];
int main()
{
f.get(c,'\n');
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;
}