Cod sursa(job #562772)
Utilizator | Data | 23 martie 2011 21:21:36 | |
---|---|---|---|
Problema | Text | Scor | 80 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 1.01 kb |
#include <fstream>
//#include <string>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char a;
int cuvant,litere,k;
int main()
{ f>>a;
while(a!=EOF) { a=f.get();
if((a>='a' && a<='z') || (a>='A' && a<='Z')) {
litere++;
if(k==0) { cuvant++;
k=1;
}
}
else k=0;
}
/*while(c!=EOF){ c=f.get();
if(litera(c)){
++lit;
if(x==0){
++cuv;
x=1;
}
}
else
x=0;
}*/
g<<litere/cuvant;
f.close();
g.close();
return 0;
}