#include <stdio.h>
int main()
{char ch;scanf("%c",&ch);if(ch>='A'&&ch<='Z'){printf("%d",ch-'A'+1);}else{printf("%d",ch-'A'-31);}return 0;
}
详细解决方案
【1318】计算字母序号
热度:43 发布时间:2023-12-06 10:02:03.0
#include <stdio.h>
int main()
{char ch;scanf("%c",&ch);if(ch>='A'&&ch<='Z'){printf("%d",ch-'A'+1);}else{printf("%d",ch-'A'-31);}return 0;
}