Pagini recente » Cod sursa (job #2505507) | Cod sursa (job #1022327) | Cod sursa (job #2473999) | Cod sursa (job #704816) | Cod sursa (job #1367683)
#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);
}
media = cntc/ cnt;
fout<<media;
return 0;
}