Pagini recente » Cod sursa (job #1100327) | Cod sursa (job #2480017) | Cod sursa (job #2673371) | Cod sursa (job #2102005) | Cod sursa (job #1510683)
#include <fstream>
#include <string.h>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
char a[1000],mat[100][30],sep[]="-., :;?/'_<>()",*p;
int n=0,total=0;
int main()
{
fin.getline(a,1000);
p=strtok(a,sep);
while(p)
{
strcpy(mat[n],p);
for(int i=0;i<strlen(mat[n]);i++) total++;
n++;
p=strtok(NULL, sep);
}
fout<<(total)/n;
return 0;
}