Cod sursa(job #837313)
Utilizator | Data | 17 decembrie 2012 20:41:05 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
char a;
int k = 0,y = 0,x = 0;
while(fin.get(a)){
if(('a' <= a && a<= 'z' )|| ('A'<=a&&a<='Z')) k ++;
else{
if( k )y ++;
x += k;
k = 0;
}
}
fout<<x / y;
fin.close();
fout.close();
return 0;
}