Cod sursa(job #748606)
Utilizator | Data | 14 mai 2012 08:40:59 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 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("`~1234567890!{@#$%^&**()-}|:+?=><,./;'[]\ ",s[i]))
k++;
a=n-k;
strcat(sep,"`~1234567890!{@#$%^&**()-}|:+?=><,./;'[]\ ");
p=strtok(s,sep);
while(p!=NULL)
{z++;
p=strtok(NULL,sep);}
g<<a/z;
f.close();
g.close();
}