Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 1st, 2012  |  syntax: None  |  size: 0.31 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. int count(char a[],int length)
  2. {
  3.         int high=0;
  4.         int low=0;
  5.         for(int i=0;i<length;i++)
  6.                 91>a[i]&&a[i]>64 ? high++:123>a[i]&&a[i]>96 ? low++ :0;
  7.         return high>low ? 1:0;
  8. }
  9. int main()
  10. {
  11.         char a[9]="@#$bAa";
  12.         int length= sizeof(a)/sizeof(char);
  13.         count(a,length)==1 ?printf("true"):printf("false");
  14.        
  15. }