SHARE
TWEET

Untitled

a guest Feb 20th, 2020 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.     char c;
  5.     unsigned uppercaseChars = 0;
  6.     unsigned lowecaseChars = 0;
  7.     unsigned digits = 0;
  8.  
  9.     while(scanf("%c", &c) != EOF) {
  10.         if(c > 'a' &&  c <= 'z') {
  11.             lowecaseChars++;
  12.         } else if(c > 'A' && c < 'Z') {
  13.             uppercaseChars++;
  14.         } else {
  15.             digits++;
  16.         }
  17.     }
  18.     printf("%u %u %u", lowecaseChars, uppercaseChars, digits);
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top