Pagini recente » Cod sursa (job #2734633) | Cod sursa (job #2548035) | Diferente pentru template/girls-programming-camp-2011/header intre reviziile 4 si 10 | Cod sursa (job #2548401) | Cod sursa (job #934606)
Cod sursa(job #934606)
#include<cstring>
#include<fstream>
using namespace std;
int main()
{
char a[200],*p;
int b=0,c=0;
ifstream f("text.in");
ofstream g("text.out");
f>>a;
p=strtok(a," ,=.;!");
while(p!NULL)
{
c++;
b+=strlen(p);
p=strtok(NULL," ,=.;!");
}
if(c!=0)
g<<b/c;
f.close();
g.close();
return 0;
}