Cod sursa(job #748605)
| Utilizator | Data | 14 mai 2012 08:37:16 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
char s[1000000],sep[100];
char* p;
int i,n,z,k,a;
ifstream f("text.in");
ofstream g("text.out");
int main()
{f.getline(s,1000000);
n=strlen(s);
k=0;
for(i=0;i<=n-1;i++)
if(strchr(" ,.?-!;:(){}[]+=_*&#@$%|\/",s[i]))
k++;
a=n-k;
strcat(sep," ,.?-!;:(){}[]+=_*&#@$%|\/");
p=strtok(s,sep);
while(p!=NULL)
{z++;
p=strtok(NULL,sep);}
g<<a/z;
f.close();
g.close();
}