题解
2024-09-01 11:49:40
发布于:广东
#include<iostream>
using namespace std;
int main()
{
char n;
cin>>n;
switch(n)
{
case'a':cout<<"1";break;
case'b':cout<<"2";break;
case'c':cout<<"3";break;
case'd':cout<<"4";break;
case'e':cout<<"5";break;
case'f':cout<<"6";break;
case'g':cout<<"7";break;
case'h':cout<<"8";break;
case'i':cout<<"9";break;
case'j':cout<<"10";break;
case'k':cout<<"11";break;
case'l':cout<<"12";break;
case'm':cout<<"13";break;
case'n':cout<<"14";break;
case'o':cout<<"15";break;
case'p':cout<<"16";break;
case'q':cout<<"17";break;
case'r':cout<<"18";break;
case's':cout<<"19";break;
case't':cout<<"20";break;
case'u':cout<<"21";break;
case'v':cout<<"22";break;
case'w':cout<<"23";break;
case'x':cout<<"24";break;
case'y':cout<<"25";break;
case'z':cout<<"26";break;
case'A':cout<<"1";break;
case'B':cout<<"2";break;
case'C':cout<<"3";break;
case'D':cout<<"4";break;
case'E':cout<<"5";break;
case'F':cout<<"6";break;
case'G':cout<<"7";break;
case'H':cout<<"8";break;
case'I':cout<<"9";break;
case'J':cout<<"10";break;
case'K':cout<<"11";break;
case'L':cout<<"12";break;
case'M':cout<<"13";break;
case'N':cout<<"14";break;
case'O':cout<<"15";break;
case'P':cout<<"16";break;
case'Q':cout<<"17";break;
case'R':cout<<"18";break;
case'S':cout<<"19";break;
case'T':cout<<"20";break;
case'U':cout<<"21";break;
case'V':cout<<"22";break;
case'W':cout<<"23";break;
case'X':cout<<"24";break;
case'Y':cout<<"25";break;
case'Z':cout<<"26";break;
}
return 0;
}
这里空空如也
有帮助,赞一个