Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(void) {
- char in[4];
- int year;
- scanf("%3s", in);
- switch (in[0]) {
- case 'm':
- case 'M':
- year = 1867;
- break;
- case 't':
- case 'T':
- year = 1911;
- break;
- case 's':
- case 'S':
- year = 1925;
- break;
- case 'h':
- case 'H':
- year = 1988;
- break;
- default:
- exit(1);
- }
- printf("%d\n", year + atoi(in + 1));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement