Cod sursa(job #2069085)
Utilizator | Data | 18 noiembrie 2017 11:56:01 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | evaluare_cex_sv_cls_x | Marime | 0.57 kb |
#include <fstream>
#include <string>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
int main()
{
int k=0, p=0, i, q, w=0;
string c;
while(f>>c)
{
q=0;
for(i=0; i<c.size(); i++)
{
if(isalpha(c[i]))
{
k++;
q++;
}
if(q!=0)
if(c[i]=='-')
w++;
}
if(q!=0)
{
p++;
p=p+w;
w=0;
}
}
g<<k/p;
return 0;
}