Cod sursa(job #1322973)

Utilizator EfrimoviciEfrim Razvan Efrimovici Data 20 ianuarie 2015 16:10:42
Problema Text Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.53 kb
#include<fstream>
using namespace std;
int main()
{
 ifstream fin ("text.in");
 ofstream fout ("text.out");
 char ch;
 int sum=0,l=0;
 bool flag=false;
 while(!fin.eof())
 {
  fin.get(ch);    
  if(ch>=65&&ch<=90)
  {
    sum++;
    flag=true;                 
  }          
  if(ch>=97&&ch<=122)
  {
    sum++;
    flag=true;                 
  }          
  if(ch<65||ch>122) 
  { if(flag==true)
    {
     l++;flag=false;
    }
  }
 }
 if(ch>=97&&ch<=122)
 l++;
 if(ch>=65&&ch<=90)
 l++;
 fout<<sum/l;   
}