Cod sursa(job #1187132)
| Utilizator | Data | 17 mai 2014 18:12:51 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.58 kb |
#include<cstdio>
#include<string.h>
#include<fstream>
using namespace std;
char s[100000000];
int main()
{
/*FILE *f=fopen("text.in","r");
FILE *g=fopen("text.out","w");*/
fstream f,g;
f.open("text.in",ios::in);
g.open("text.out",ios::out);
char *p;
int lungime=0,numar=0;
f.getline(s,100000000);
p=strtok(s," ~!@#$%^&*()_+{}|<->?/.,';\][=-0987654321`");
while(p!=NULL)
{
lungime=lungime+strlen(p);
numar=numar+1;
p=strtok(NULL," ~!@#$%^&*()_+{}|<>?/.,-';\][=-0987654321`");
}
g<<lungime/numar;
}
