Cod sursa(job #1510681)
Utilizator | Data | 25 octombrie 2015 15:03:53 | |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <fstream>
#include <string.h>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
char a[1000],mat[100][30],sep[]="-., :;?/'_<>()",*p;
int n=0,total=0;
int main()
{
fin.getline(a,1000);
p=strtok(a,sep);
while(p)
{
strcpy(mat[n],p);
for(int i=0;i<strlen(mat[n]);i++) total++;
n++;
p=strtok(NULL, sep);
}
fout<<(total-1)/n;
return 0;
}