Cod sursa(job #380450)

Utilizator Bogdan_CCebere Bogdan Bogdan_C Data 6 ianuarie 2010 10:32:10
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include<cstdio>
#include<cstdlib>
using namespace std;
#define FIN "text.in"
#define FOUT "text.out"
int main()
{freopen(FIN,"r",stdin);
freopen(FOUT,"w",stdout);
char c;
int contor=0,lg=0,curent=0;
scanf("%c",&c);
while(c!='\n')
 {if(('a'<=c && c<='z')||('A'<=c && c<='Z'))
  {lg++;
  if(curent==0) curent=1;
             }
   else {if(curent==1) {curent=0;contor++;}
        }          
  scanf("%c",&c);      
        }
  printf("%d",lg/contor);      
    
    return 0;}