Cod sursa(job #683231)
| Utilizator | Data | 20 februarie 2012 11:56:35 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.38 kb |
# include <fstream>
using namespace std;
int main(void){ ifstream txt("text.in"); ofstream ma("text.out");
char c;
int x,l=0,cuv=0,w,d=35;
while(!txt.eof()){
txt.get(c);
w=0;
x=(int)c;
if((x>=65 && x<=90)||(x>=97 && x<=122)){
w=1;
l++;
}
if(w &&(d<65||d>90&&d<97||d>122)) cuv++;
d=x;
}
ma<<l/cuv;
txt.close();
ma.close();
return 0;
}