Cod sursa(job #1570214)
| Utilizator | Data | 16 ianuarie 2016 11:44:33 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <iostream>
#include <fstream>
using namespace std;
string s;
int w,l,n,i,a=0,b;
float c;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
getline (f,s);
n=s.length();
for (i=0;i<=n-1;i++)
{
if (((s[i]>=65) and (s[i]<=90)) or ((s[i]>=97) and (s[i]<=122))) {if (a==0) a=i;b=i;l++;}
}
for (i=a;i<=b;i++)
{
if ((s[i]==' ') or (s[i]=='-')) w++;
}
w++;
c=l/w;
g<<c;
return 0;
}
