Cod sursa(job #2705261)

Utilizator alex1033Alex Putineanu alex1033 Data 12 februarie 2021 11:50:21
Problema Text Scor 40
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;

ifstream in("text.in");
ofstream out("text.out");
int main(){
char s[1000001],s1[1000001],*p;
long long n,i,ct=0,cti=0;
in.get(s,100001);
strcpy(s1,s);
p=strtok(s,"!@#$%^&*(){}[]-_=+;:<>,.?/\| ");
while(p!=NULL){
ct++;
p=strtok(NULL,"!@#$%^&*(){}[]-_=+;:<>,.?/\| ");

}

for(i=0;i<strlen(s1);i++)
if(isalpha(s1[i])>0)
cti++;
out<<cti/ct;

return 0;
}