Cod sursa(job #401410)
| Utilizator | Data | 22 februarie 2010 20:44:50 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | pcon1 | Marime | 0.49 kb |
#include <fstream>
#include<iostream>
using namespace std;
char s[1600];
ofstream g("text.out");
void citire()
{
ifstream f("text.in");
f.get(s,1000);
f.close();
}
int main()
{
citire();
int nr=0,leng=0;
char *p;
p=strtok(s," /.,';\][=-+_|}{?><`!~@#$%^&*()");
while(p)
{
nr++;
leng+=strlen(p);
p=strtok(NULL," /.,';\][=-+_|}{?><`!~@#$%^&*()");
}
int rez=leng/nr;
g<<rez;
return 0;
}
