Listing 1 This program allows us to separate input items by commas.

#include <stdio.h>

main()
{
    int n;
    char c;

    while (scanf("%d , %c%c",&n, &c) == 2)
       printf ("%d, %c\n",n,c);
    return 0;
}

/*
SAMPLE INPUT
----
123,a
123 , a
123
,
a
123a

SAMPLE OUTPUT
----
123, a
123, a
123, a
<error>
*/

/* End of File */