Pagini recente » Cod sursa (job #2484409) | Cod sursa (job #2473986) | Cod sursa (job #663162) | Cod sursa (job #220737) | Cod sursa (job #1367721)
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s[10000];
int media, cnt, cntc;
int main(){
fin.getline(s, 10000);
char sep[] = "_ 1234567890,.?/!;\'-@#$%^&*(){}[]|:<>+~`" ;
char *p = strtok(s, sep);
while(p)
{
cnt++;
for(int i = 0; i < strlen(p); i++)
cntc++;
p = strtok(NULL, sep);
}
if(cnt == 0)
fout<<1;
else
{
media = cntc/ cnt;
fout<<media;
}
return 0;
}