求助
// ConsoleApplication20.cpp : 定义控制台应用程序的入口点。//
#include "stdafx.h"
#include <process.h>
int _tmain(int argc, _TCHAR* argv[])
{
int ascii_num;
printf("请输入一个ascii十进制的数字");
scanf_s("%d, & ascii_num");
if (ascii_num >= 48 && ascii_num <= 57)
{
printf("%d对应的ascii数字是:%c\n", ascii_num, ascii_num);
}
else if (ascii_num >= 65 && ascii_num <= 90)
{
printf("%c对应的ascii大写字母是:%c\n", ascii_num, ascii_num);
}
else if (ascii_num >= 97 && ascii_num <= 122)
{
printf("%c对应的ascii小写字母是: %c\n", ascii_num, ascii_num);
}
else
{
printf("你输入的数字对应的ascii不是一个数字或字母");
}
system("pause");
return 0;
}
//错误 1 error C4700: 使用了未初始化的局部变量“ascii_num"
页:
[1]