Cod sursa(job #1570246)
| Utilizator | Data | 16 ianuarie 2016 11:57:22 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <iostream>
#include <fstream>
using namespace std;
string s;
int w,l,n,i,k=0,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))) {l++;k=1;}
else if ((k==1) and ((s[i]==' ') or (s[i]=='-'))) {w++;k=0;}
}
w++;
if (k==0) w--;
c=l/w;
g<<c;
return 0;
}
