Cod sursa(job #401444)
| Utilizator | Data | 22 februarie 2010 20:59:00 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| 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," /.,';=-+_|}{][?><`!~@#$%^&*()1234567890");
while(p)
{
nr++;
leng+=strlen(p);
p=strtok(NULL," /.,';=-+_|}{][?><`!~@#$%^&*()1234567890");
}
g<<leng/nr;
return 0;
}
