Cod sursa(job #1577416)
Utilizator | Data | 23 ianuarie 2016 13:58:40 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#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;
}