Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 20161029 phonenum.cpp : 定義主控台應用程式的進入點。
- //
- #include "stdio.h"
- #include <ctype.h>
- int main()
- {
- char s[100], two[] = { 'A','B','C' }, three[] = { 'D','E','F' }, four[] = { 'G','H','I' };
- char five[] = { 'J','K','L' }, six[] = { 'M','N','O' }, seven[] = { 'P','R','S' }, eight[] = { 'T','U','V' }, night[] = { 'W','X','Y' };
- while (gets(s) != NULL)
- {
- int i = 0,j=0;
- char num[7];
- while (*(s + i) != '\0')
- {
- if (isdigit(*(s + i)))
- {
- num[j] = *(s + i);
- printf("%c\n", num[j]);
- j++;
- }
- i++;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement