Cod sursa(job #923826)
| Utilizator | Data | 23 martie 2013 21:22:15 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.6 kb |
#include <fstream>
#include <iostream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main(){
char T[100001];
long p=0;
long lit=0, cuv=1;
f.getline(T,100000);
while (((T[p]<'a')||(T[p]>'z'))&&((T[p]<'A')||(T[p]>'Z'))){
p++;
}
for (long i=p+1;i<=strlen(T);i++){
if (((T[i]>='a')&&(T[i]<='z'))||((T[i]>='A')&&(T[i]<='Z')))
lit++;
if (T[i]==' ')
cuv++;
if (T[i]=='-')
cuv++;
}
g<<lit/cuv<<"\n";
g.close();
return 0;
}
