Cod sursa(job #2700048)

Utilizator alex1033Alex Putineanu alex1033 Data 26 ianuarie 2021 13:39:13
Problema Text Scor 40
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.54 kb
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstring>
using namespace std;

ifstream in("text.in");
ofstream out("text.out");
int main()
{
char s[1001],*p;
long long i,lm,S=0,ct=0,j,cti=0;
in.get(s,1001);

p=strtok(s,"!#%&')(*+,.-/01234567890:;<=>?@[\]^_}\{ ");
while(p!=NULL){
ct++;
for(j=0;j<strlen(p);j++)
if(!strchr("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",p[j])>0)
cti++;
S=S+strlen(p);
p=strtok(NULL,"!#%&')(*+,.-/01234567890:;<=>?@[\]^_}\{ ");
}

out<<(S-cti)/ct;


    return 0;
}