1个回答
展开全部
C语言程序:
#include <stdio.h>
void main()
{
char ch = 'G';
int value = 'G';
printf("input a character : ");
ch = getchar();
value = ch;
getchar();
if(ch >= 'a' && ch <= 'z')
ch -= 32;
printf("%c %d\n", ch, value);
printf("input a character : ");
scanf("%c", &ch);
value = ch;
if(ch >= 'a' && ch <= 'z')
ch -= 32;
printf("%c %d\n", ch, value);
}
运行测试:
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询