Cod sursa(job #811855)
Utilizator | Data | 12 noiembrie 2012 23:59:00 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
# include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int k,sum;
char c1,c2;
int main()
{
c1=' ';sum=k=0;
while( f.get(c2) )
{
if(((65<=c2)&&(c2<=90))||((97<=c2)&&(c2<=122)))sum++;
else if(((65<=c1)&&(c1<=90))||((97<=c1)&&(c1<=122)))k++;
c1=c2;
if(c2=='\n')break;
}
g<<sum/k<<'\n';
}