提交 65a59bc9 创建 作者: 赵鹏翀's avatar 赵鹏翀

init template

上级
/Debug
/Release
\ No newline at end of file
<?xml version="1.0" encoding="gb2312"?>
<ASMProject Version="1.00" Name="Demo025" TemplatePath="console(c)\Project" ProjectID="ded50f14-e218-4e26-9751-255a941e3f83" IsSubmitWork="0">
<Configurations>
<Configuration Name="Debug" DebuggerFlavor="0">
<Tool Name="PreBuildEventTool"/>
<Tool Name="CustomBuildTool"/>
<Tool Name="GCCCompilerTool" PreprocessorDefinitions="_DEBUG" GenerateDebugInformation="-1" LanguageStandard="c99"/>
<Tool Name="PreLinkEventTool"/>
<Tool Name="GCCLinkerTool"/>
<Tool Name="PostBuildEventTool"/>
</Configuration>
<Configuration Name="Release" DebuggerFlavor="0">
<Tool Name="PreBuildEventTool"/>
<Tool Name="CustomBuildTool"/>
<Tool Name="GCCCompilerTool" PreprocessorDefinitions="NDEBUG" LanguageStandard="c99"/>
<Tool Name="PreLinkEventTool"/>
<Tool Name="GCCLinkerTool" StripDebugInfo="-1"/>
<Tool Name="PostBuildEventTool"/>
</Configuration>
</Configurations>
<Files>
<Filter Name="ͷļ" Filter="h;hpp;hxx">
<File RelativePath=".\console.h">
</File>
</Filter>
<Filter Name="Դļ" Filter="cpp;c;cc;cxx">
<File RelativePath=".\console.c">
</File>
</Filter>
</Files>
</ASMProject>
添加文件
#include "console.h"
int main(int argc, char* argv[])
{
int x;
printf("十进制转换为十六进制\n请输入需要转换的数字:\n");
scanf("%d", &x);
int j, k;
int p[30];
for(j=0; x!=0; j++)
{
p[j] = x%16;
x = x/16;
if(p[j] < 10)
p[j] += 48;
else
{
switch(p[j])
{
case 10 : p[j] = 'A';
break;
case 11 : p[j] = 'B';
break;
case 12 : p[j] = 'C';
break;
case 13 : p[j] = 'D';
break;
case 14 : p[j] = 'E';
break;
case 15 : p[j] = 'F';
break;
default:
break;
}
}
}
printf("转换为十六进制:");
for(k=j-1; k>=0; k--)
{
printf("%c", p[k]);
}
printf("\n");
return 0;
}
#ifndef _CONSOLE_H_
#define _CONSOLE_H_
#include <stdio.h>
/* TODO: 在此处引用程序需要的其他头文件 */
#endif /* _CONSOLE_H_ */
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论