为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

C语言设计将十六进制数转换成十进制数的函数

2017-09-27 10页 doc 42KB 29阅读

用户头像

is_882336

暂无简介

举报
C语言设计将十六进制数转换成十进制数的函数C语言设计将十六进制数转换成十进制数的函数 课程设计任务书 学 院 物电学院 专 业 电子信息科学与技术 学 生 姓 名 张三 学 号 **** 设 计 题 目 编程技术基础实训 内容及要求: 利用C语言编写下题的代码。 题目名称:设计将十六进制数转换成十进制数的函数和员工信息管理程序。 内容及要求: 1、十六进制转换成十进制数:写一个函数,输入一个十六进制数,输出相应的十进制数。 。 软件开发环境 Windows XP,TC2.0或Visual C++ 6.0 进度安排: 第18周: 1(算法设计 ...
C语言设计将十六进制数转换成十进制数的函数
C语言将十六进制数转换成十进制数的函数 课程设计任务书 学 院 物电学院 专 业 电子信息科学与技术 学 生 姓 名 张三 学 号 **** 设 计 题 目 编程技术基础实训 内容及要求: 利用C语言编写下题的代码。 题目名称:设计将十六进制数转换成十进制数的函数和员工信息管理程序。 内容及要求: 1、十六进制转换成十进制数:写一个函数,输入一个十六进制数,输出相应的十进制数。 。 软件开发环境 Windows XP,TC2.0或Visual C++ 6.0 进度安排: 第18周: 1(算法设计 2(编写程序代码 3(调试程序 4(答辩、验收程序 指导教师(签字): 学院院长(签字): 年 月 日 年 月 日 feel free to listen to their voices and help the masses solve problems, we were officially opened on May 10 "12345" Mayor calls, formulated rules and regulations, equipped with a full-time staff, a 24-hour on-duty system, people to call to receive, reply, action, reminders, feedback and so on. By year end, handled the crowd calls 1076, 94.7% feedback rate. By Mayor calls active coordination to solve a large number of bears on the immediate interests of the people and issues of great lives, but also for leadership research and decision to collect a lot of good ideas and suggestions, by all sectors of the community alike. Second, start Municipal Government Affairs Hall built. On May 11, we built and launched the city-government lobby, were settled in 12 departments, strict implementation of first asking duty system, service system, system of gratuitous, "receiving, internal coordination, head of the window handle, limited time concluded" one-stop service. By the end of today to accept various types of 3,273, originally of up to 100%. Running Government Affairs Hall, the convenience of the masses, promoting open Government, improve the investment environment and solve their practical problems, and so did a lot of work, masses, serve the community for the Government to play a very good "window, link, model". Third, create a city government public affairs network. We rely on the Government Web site, was completed on May 24, the province's first public affairs network. Over 一、题目要求 题目名称:设计将十六进制数转换成十进制数的函数和员工信息管理程序。 内容: 1、十六进制转换成十进制数:写一个函数,输入一个十六进制数,输出相应的十进制 数。 要求: 利用C语言编写上述程序,开发环境可采用Turbo C 2.0 或Visual C++ 6.0等。 feel free to listen to their voices and help the masses solve problems, we were officially opened on May 10 "12345" Mayor calls, formulated rules and regulations, equipped with a full-time staff, a 24-hour on-duty system, people to call to receive, reply, action, reminders, feedback and so on. By year end, handled the crowd calls 1076, 94.7% feedback rate. By Mayor calls active coordination to solve a large number of bears on the immediate interests of the people and issues of great lives, but also for leadership research and decision to collect a lot of good ideas and suggestions, by all sectors of the community alike. Second, start Municipal Government Affairs Hall built. On May 11, we built and launched the city-government lobby, were settled in 12 departments, strict implementation of first asking duty system, service system, system of gratuitous, "receiving, internal coordination, head of the window handle, limited time concluded" one-stop service. By the end of today to accept various types of 3,273, originally of up to 100%. Running Government Affairs Hall, the convenience of the masses, promoting open Government, improve the investment environment and solve their practical problems, and so did a lot of work, masses, serve the community for the Government to play a very good "window, link, model". Third, create a city government public affairs network. We rely on the Government Web site, was completed on May 24, the province's first public affairs network. Over No. 1 二、算法设计 1、十六进制转换成十进制数:写一个函数,输入一个十六进制数,输出相应的十进制数。 (1)把输入的十六进制数看成一个数组(char s[N]),十六进制各个位的字符代为相应数组的元素(s[i])。 (2)写出主函数通过调用将十六进制数转为十进制数的函数(fun),实现将十六进制数转为十进制数。 (3)程序图如下图1 开始 输入十六进制数字符串s[N] S[i]是否大于10 t=s[i]-‘a’+10 t=s[i]-‘0’ sum=sum*16+t i=0,i++ i<=N? 输出十进制结果sum 结束 程序1 三、编程实现 程序的具体C语言代码如下: feel free to listen to their voices and help the masses solve problems, we were officially opened on May 10 "12345" Mayor calls, formulated rules and regulations, equipped with a full-time staff, a 24-hour on-duty system, people to call to receive, reply, action, reminders, feedback and so on. By year end, handled the crowd calls 1076, 94.7% feedback rate. By Mayor calls active coordination to solve a large number of bears on the immediate interests of the people and issues of great lives, but also for leadership research and decision to collect a lot of good ideas and suggestions, by all sectors of the community alike. Second, start Municipal Government Affairs Hall built. On May 11, we built and launched the city-government lobby, were settled in 12 departments, strict implementation of first asking duty system, service system, system of gratuitous, "receiving, internal coordination, head of the window handle, limited time concluded" one-stop service. By the end of today to accept various types of 3,273, originally of up to 100%. Running Government Affairs Hall, the convenience of the masses, promoting open Government, improve the investment environment and solve their practical problems, and so did a lot of work, masses, serve the community for the Government to play a very good "window, link, model". Third, create a city government public affairs network. We rely on the Government Web site, was completed on May 24, the province's first public affairs network. Over 沈阳理工大学 第1题: #include long fun(char*s); #define N 50 void main() { long m; char s[N]; printf("输入十六进制数:"); scanf("%s",s); m=fun(s); printf("十进制数为:%ld",m); } long fun(char*s) { int i,t; long sum=0; for(i=0;s[i];i++) { if(s[i]<='9')t=s[i]-'0'; else t=s[i]-'a'+10; sum=sum*16+t; } return sum; } 四、结果分析 第1题: 程序运行结果如图1: feel free to listen to their voices and help the masses solve problems, we were officially opened on May 10 "12345" Mayor calls, formulated rules and regulations, equipped with a full-time staff, a 24-hour on-duty system, people to call to receive, reply, action, reminders, feedback and so on. By year end, handled the crowd calls 1076, 94.7% feedback rate. By Mayor calls active coordination to solve a large number of bears on the immediate interests of the people and issues of great lives, but also for leadership research and decision to collect a lot of good ideas and suggestions, by all sectors of the community alike. Second, start Municipal Government Affairs Hall built. On May 11, we built and launched the city-government lobby, were settled in 12 departments, strict implementation of first asking duty system, service system, system of gratuitous, "receiving, internal coordination, head of the window handle, limited time concluded" one-stop service. By the end of today to accept various types of 3,273, originally of up to 100%. Running Government Affairs Hall, the convenience of the masses, promoting open Government, improve the investment environment and solve their practical problems, and so did a lot of work, masses, serve the community for the Government to play a very good "window, link, model". Third, create a city government public affairs network. We rely on the Government Web site, was completed on May 24, the province's first public affairs network. Over No. 3 图1 程序运行结果1 feel free to listen to their voices and help the masses solve problems, we were officially opened on May 10 "12345" Mayor calls, formulated rules and regulations, equipped with a full-time staff, a 24-hour on-duty system, people to call to receive, reply, action, reminders, feedback and so on. By year end, handled the crowd calls 1076, 94.7% feedback rate. By Mayor calls active coordination to solve a large number of bears on the immediate interests of the people and issues of great lives, but also for leadership research and decision to collect a lot of good ideas and suggestions, by all sectors of the community alike. Second, start Municipal Government Affairs Hall built. On May 11, we built and launched the city-government lobby, were settled in 12 departments, strict implementation of first asking duty system, service system, system of gratuitous, "receiving, internal coordination, head of the window handle, limited time concluded" one-stop service. By the end of today to accept various types of 3,273, originally of up to 100%. Running Government Affairs Hall, the convenience of the masses, promoting open Government, improve the investment environment and solve their practical problems, and so did a lot of work, masses, serve the community for the Government to play a very good "window, link, model". Third, create a city government public affairs network. We rely on the Government Web site, was completed on May 24, the province's first public affairs network. Over 沈阳理工大学 五、参考文献 [1]马秀丽,刘志妩,李筠.C语言程序设计.北京:清华大学出版社,2008 [2]谭浩强.C程序设计(第2版).北京:清华大学出版社,2004 feel free to listen to their voices and help the masses solve problems, we were officially opened on May 10 "12345" Mayor calls, formulated rules and regulations, equipped with a full-time staff, a 24-hour on-duty system, people to call to receive, reply, action, reminders, feedback and so on. By year end, handled the crowd calls 1076, 94.7% feedback rate. By Mayor calls active coordination to solve a large number of bears on the immediate interests of the people and issues of great lives, but also for leadership research and decision to collect a lot of good ideas and suggestions, by all sectors of the community alike. Second, start Municipal Government Affairs Hall built. On May 11, we built and launched the city-government lobby, were settled in 12 departments, strict implementation of first asking duty system, service system, system of gratuitous, "receiving, internal coordination, head of the window handle, limited time concluded" one-stop service. By the end of today to accept various types of 3,273, originally of up to 100%. Running Government Affairs Hall, the convenience of the masses, promoting open Government, improve the investment environment and solve their practical problems, and so did a lot of work, masses, serve the community for the Government to play a very good "window, link, model". Third, create a city government public affairs network. We rely on the Government Web site, was completed on May 24, the province's first public affairs network. Over
/
本文档为【C语言设计将十六进制数转换成十进制数的函数】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索