Cod sursa(job #536342)
| Utilizator | Data | 18 februarie 2011 16:07:16 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<fstream>
#include<string>
#include<ctype.h>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
int main(){
char s[1001000];
int cv=0,i,ok=0,slit=0,lit=0,n;
fin.get(s,1000999);
n=strlen(s);
for(i=1;i<n;i++)
if(isalpha(s[i])){
ok=1;
lit++;
}
else if(ok==1){
ok=0;
slit+=lit;
lit=0;
cv++;
}
fout<<slit/cv;
}