Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- /*
- * Example input:
- * CSCE 1010 Introduction to Computer Science
- */
- static void parse_error()
- {
- fprintf(stderr, "Invalid input\n");
- }
- int main(void)
- {
- char prefix[5];
- int number;
- char name[101];
- while(!feof(stdin)) {
- if(! scanf("%4s", prefix))
- continue; // empty line
- if(! scanf("%d %100[^\n]", &number, name)) {
- parse_error();
- break;
- }
- printf("%s\t%d\t%s\n", prefix, number, name);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement