#10425: C語言打法參考


dddd1597 (johnson0331)

School : 臺北市立內湖高級工業職業學校
ID : 51316
IP address : [61.216.112.118]
Last Login :
2017-12-31 16:16:44
d670. 10921 - Find the Telephone -- UVa10921 | From: [118.169.125.67] | Post Date : 2015-11-03 21:30

 

#include <stdio.h>

int main() {

char s[27] = "22233344455566677778889999";

char str[50];

while(scanf("%s", str)!=EOF) {

int i;

for(i = 0; str[i]; i++) {

if(str[i] >= 'A' && str[i] <= 'Z')

printf("%c", s[str[i]-'A']);

else

printf("%c", str[i]);

}

puts("");

}

    return 0;

}

 
ZeroJudge Forum