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