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