Cod sursa(job #696496)
Utilizator | Data | 28 februarie 2012 18:45:48 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include<string.h>
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
char a[100],*c;
fstream f("text.in",ios::in),g("text.out",ios::out);
int n=0,nr=0;
f.get(a,100);
c=strtok(a,",. ;:-");
while(c)
{
n=n+strlen(c);
nr++;
c=strtok(NULL,",. ;:-");
}
g<<n/nr;
return 0;
}