Cod sursa(job #2888749)
Utilizator | Bia Lungu lungubianca | Data | 11 aprilie 2022 20:05:21 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main()
{
char t[101],s1[]=" .,?!-:;";
long long l=0,c=0;
in.getline(t,101);
for(long long i=0;i<strlen(t);i++)
if(strchr(s1,t[i]))
l++;
l=strlen(t)-l;
char *p=strtok(t,s1);
while(p)
{
c++;
p=strtok(NULL,s1);
}
out<<l/c;
return 0;
}