Mai intai trebuie sa te autentifici.
Cod sursa(job #536360)
| Utilizator | Data | 18 februarie 2011 16:24:54 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| 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=0;i<n;i++)
if(isalpha(s[i])){
ok=1;
slit++;
}
else if(ok==1){
ok=0;
cv++;
}
if(cv==0) fout<<0;
else fout<<slit/cv;
}