Cod sursa(job #1577423)
Utilizator | Data | 23 ianuarie 2016 14:01:06 | |
---|---|---|---|
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;
int main()
{ ifstream f("text.in");
ofstream g("text.out");
int i,cuv=0,lit=0;
char s[250],v[]="~`!@#$%^&*()_-+=><.,?/\|;:(){}[]' ",b[250],*p,sep[]="~`!@#$%^&*_-+=><.,?/\|;:(){}[]' ";
f.getline (s,250);
for(i=0;i<strlen(s);i++)
{ if(strchr(sep,s[i])==0) lit++;
}
p=strtok(s,sep);
while(p)
{cuv++;
p=strtok(NULL,sep);
}
g<<lit/cuv;
}