Pagini recente » Cod sursa (job #3158638) | Diferente pentru problema/rsp intre reviziile 4 si 17 | Cod sursa (job #2561303) | Statistici Cristina Braga (CristinaB24) | Cod sursa (job #1577416)
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
int main()
{
char s[100],*p,sep[]=" -,.?!;':()[]{}*&@~`><+=_";
int n,i=0,l=0,a=0;
ifstream f("text.in");
ofstream g("text.out");
float m=0;
f>>s;
p=strtok(s,sep);
while(p)
{
n=strlen(p);
l++;
a+=n;
p=strtok(NULL,sep);
}
m=a/l;
g<<m;
}