Cod sursa(job #1376559)
Utilizator | Data | 5 martie 2015 17:49:59 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[20000],*p,sep[]=",.?!- ";
int k,n,r,i;
int main()
{f.get(s,2000);
f.get();
n=strlen(s);
for(i=1;i<=n;i++)
if(strchr("qwertyuioplkjhgfdsazxcvbnm",s[i]))
r++;
p=strtok(s,sep);
while(p)
{
k++;
p=strtok(NULL,sep);
}
g<<r/k;
return 0;
}