Cod sursa(job #658414)
| Utilizator | Data | 8 ianuarie 2012 20:20:24 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <fstream>
using namespace std;
int main(){
ifstream fin("text.in");
fin>>noskipws;
ofstream fout("text.out");
int nc,nl;
char ca,cc;
nc=nl=0;
fin>>ca;
do{
fin>>cc;
if(ca>='a'&&ca<='z' || ca>='A'&&ca<='Z') {
nl++;
if(!(cc>='a'&&cc<='z' || cc>='A'&&cc<='Z')) nc++;
}
ca=cc;
}while(!fin.eof());
fout<<nl/nc;
fout.close();
return 0;
}
