home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.fan.starwars      Another Star Wars fan-base      46,595 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 46,034 of 46,595   
   Robert Spanjaard to Mr. Man-wai Chang   
   Re: The assignment for today's lesson   
   12 Nov 16 21:36:24   
   
   XPost: comp.lang.c   
   From: spamtrap@arumes.com   
      
   On 12-11-16 16:43, Mr. Man-wai Chang wrote:   
   > On 12/11/2016 11:38 PM, Robert Spanjaard wrote:   
   >>   
   >> I can't. System reports a Clown Overflow everytime it encounters "trump".   
   >>   
   >   
   > You are NOT doing the homework. :)   
      
   Ok, ok...   
      
   #include    
      
   int main()   
   {	   
       char	chewb;	/* current character being processed */   
       int	r2d2,	/* number of numbers */   
       	c3po;	/* number of letters */   
      
       while ((chewb = getchar()) != EOF)   
          if ((chewb >= 'a' && chewb <= 'z') || (chewb >= 'A' && chewb <= 'Z'))   
             ++c3po;   
          else if (chewb >= '0' && chewb <= '9')   
             ++r2d2;   
      
       printf("Number of letters: %i\nNumber of numbers: %i\n", c3po, r2d2);   
       return 0;   
   }   
      
   Be careful to only run this once. Chewbacca doesn't like doing all the hard   
   work, and letting the droids get away with the results.   
      
   --   
   Robert Spanjaard   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca