Cod sursa(job #2728126)

Utilizator alex1033Alex Putineanu alex1033 Data 22 martie 2021 20:13:31
Problema Text Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <bits/stdc++.h>
using namespace std;

ifstream in("text.in");
ofstream out("text.out");

char s[1000001],*p;
int n;

void read(){
in.get(s,1000001);
n=strlen(s)-1;
}

void solve(){
int nrc,lg;
for(int i=0;i<=n;i++)
if(isalpha(s[i]))
lg++;


p=strtok(s," 1234567890.,;;''[[]]{}-_=+!@#$%^&*|<>,.?/\| \`~");
while(p){
nrc++;
p=strtok(NULL," 1234567890.,;;''[[]]{}-_=+!@#$%^<>,.?/\| &*|\`~");

}


out<<lg/nrc;
}



int main(){
read();
solve();


return 0;
}