Pagini recente » Cod sursa (job #664271) | Borderou de evaluare (job #2357054) | Cod sursa (job #2145871) | Borderou de evaluare (job #1414476) | Cod sursa (job #2218092)
#include <fstream>
#include <string.h>
using namespace std;
const int INT=1024;
ifstream in("text.in");
ofstream out("text.out");
int main(){
char s[INT],*p;
int caractere=0;
int cuvinte=0;
in.get(s,INT);
p=strtok(s,"-,.!? ");
while(p!=NULL){
cuvinte++;
caractere+=strlen(p);
p=strtok(NULL,"-,.!? ");
}
out<<caractere/cuvinte;
return 0;
}