Pagini recente » Cod sursa (job #983037) | Cod sursa (job #689711) | Cod sursa (job #2847901) | Cod sursa (job #594190) | Cod sursa (job #2700054)
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstring>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main()
{
char s[1001],*p;
long long i,lm,S=0,ct=0,j,cti=0,ctp=0;
in.get(s,1001);
p=strtok(s," ");
while(p!=NULL){
ct++;
for(j=0;j<strlen(p);j++){
if(strchr("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",p[j])>0)
cti++;
ctp++;
}
S=S+strlen(p);
p=strtok(NULL," ");
}
if(ctp==0) out<<0;
else{
S=(ctp+cti)-ctp;
out<<S/ct;
}
return 0;
}