Cod sursa(job #1171815)
Utilizator | Data | 16 aprilie 2014 13:34:30 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <fstream>
std::ifstream fin("text.in");
std::ofstream fout("text.out");
int main()
{
int count = 0, count1 = 0;
char c;
bool f = 0;
while(!fin.eof())
{
c = fin.get();
if((c>= 'A' && c<= 'Z') || (c>= 'a' && c<= 'z')) {f= 1;count++;}
else if(f == 1){f = 0;count1++;}
}
fout<<count/count1<<"\n";
return 0;
}