Start: Jul, 05, 2019 08:40:00
2019年度暑期短学期达标测试
End: Jul, 05, 2019 11:40:00
Time elapsed:
Time remaining:

Problem_ID: D
Result: Accepted
Time: 4ms
Memory: 1116kB
Author: CT12812561281
In contest: 1281

#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main() {
	int len, i;
	char str[100];
	while(~scanf("%s", str)){
	  len = strlen(str);
      for(i = 0;i < len;i ++) {
      	if(!islower(str[i])){
      	  str[i] = tolower(str[i]);	
      	  if(str[i] - 'a' >= 0 && str[i] - 'a' <= 25){
      	    if(str[i] != 'z') {
      	      str[i] += 1;	
			}else {
			  str[i] = 'a';
			}	
		  }
		}else {
		   if(str[i]- 'a' >= 0 && str[i]- 'a' <= 2) {
		   	  str[i] = '2';
		   }else if(str[i]- 'd' >= 0 && str[i]- 'd' <= 2) {
		   	  str[i] = '3';
		   }else if(str[i]- 'g' >= 0 && str[i]- 'g' <= 2) {
		   	  str[i] = '4';
		   }else if(str[i]- 'j' >= 0 && str[i]- 'j' <= 2) {
		   	  str[i] = '5';
		   }else if(str[i]- 'm' >= 0 && str[i]- 'm' <= 2) {
		   	  str[i] = '6';
		   }else if(str[i]- 'p' >= 0 && str[i]- 'p' <= 3) {
		   	  str[i] = '7';
		   }else if(str[i]- 't' >= 0 && str[i]- 't' <= 2) {
		   	  str[i] = '8';
		   }else if(str[i]- 'w' >= 0 && str[i]- 'w' <= 3){
		   	  str[i] = '9';
		   }
		}
	  }
	  printf("%s\n", str);	
	}
	return 0;
}