home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_10 / 1010024b < prev    next >
Text File  |  1992-09-01  |  294b  |  17 lines

  1. #include <stdio.h>
  2.  
  3. #define MAXLINE 80
  4.  
  5. main()
  6. {
  7.     int n;
  8.     char c, buf[MAXLINE+1];
  9.     
  10.     while (gets(buf))
  11.         if (sscanf(buf,"%d , %c",&n, &c) == 2)
  12.             printf("%d, %c\n",n,c);
  13.         else
  14.             printf("Invalid input: \"%s\"\n",buf);
  15.     return 0;
  16. }
  17.