Cod sursa(job #2135302)
Utilizator | Data | 18 februarie 2018 18:58:02 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[300],sep[]=" 1234567890!@#$%^&*()_+=-0,-.:\";!?\'";
int S,c;
int main()
{
char *p;
f.get(s,300);
p=strtok(s,sep);
while(p)
{ S+=strlen(p);
c++;
p=strtok(NULL,sep);
}
g<<S/c;
return 0;
}