Cod sursa(job #1026467)
Utilizator | Data | 11 noiembrie 2013 17:36:26 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int nrc=0,nrl=0;
char t[505];
fgets(t,500,stdin);
int l=strlen(t)-1;
for(int i=1;i<=l;++i){
if(t[i]>='a' && t[i]<='z' || t[i]>='A' && t[i]<='Z')++nrl;
if(t[i]==' ' || t[i]=='-')++nrc;
}
printf("%d",nrl/nrc);
return 0;
}