Cod sursa(job #799799)
Utilizator | Pop Flaviu Jim215 | Data | 20 octombrie 2012 09:30:15 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
string a;
long long k=0,k1=0,ok=0,i,z;
getline (f,a);
z=a.length();
for(i=0;i<=z-1;i++)
{
if( (a[i]>=65 && a[i]<=90) || ( a[i]>=97 && a[i]<=122) )
{
ok=1;k1++;
}
else
{
if(ok==1)
{ok=0;k++;}
}
}
long long r;
r=k1/k;
g<<r;
return 0;
}