Cod sursa(job #806775)
| Utilizator | Data | 3 noiembrie 2012 15:14:43 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream>
#include <string.h>
using namespace std;
char text[1000000];
int lung,i,cuv;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
f.get(text,1000000);
for(i=0;i<strlen(text);i++){
if(strchr(",.!?- ",text[i])==0)
lung++;
}
for(i=0;i<strlen(text);i++){
if(strchr(",.!?- ",text[i])!=0&&strchr(",.!?- ",text[i-1])==0){
cuv++;
}
}
g<<lung/cuv;
}
