文件名称:jinzhizhuanhuan
-
所属分类:
- 标签属性:
- 上传时间:2013-12-07
-
文件大小:353.82kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
【问题描述】编写函数itob(n,s,b),用于把整数n转换成以b为基的字符串并存储到s中. 编写程序,使用函数itob(n,s,b)将输入的整数n,转换成字符串s,将s输出.转换后的字符串从最高的非零位开始输出。如果n为负数,则输出的字符串的第一个字符为’-’。b为大于1小于37的任意自然数值。当b=2时,输出字符只可能是’0’和’1’;当b=16时,输出字符串中可能含有字符为’0’-’9’,’a’-’f’(字母以小写输出)。b还可以是其它数值。比如输入n=33,b=17,则输出33的17进制值为"1g"。
【输入形式】控制台输入整数n和b,其中n可以为负数。n和b以空格分隔.
【输出形式】控制台输出转化后的字符串s.
【样例输入】5 2
【样例输出】101
【样例说明】5的二进制就是101
【评分标准】结果完全正确得20分,每个测试点4分。提交程序名为:itob.c-[Problem Descr iption] Write a function itob (n, s, b), is used to convert the integer n base b string and stored in s. Written procedures, use the function itob (n, s, b) the input integer n, converted to a string s, the s output. strings converted from the highest non-zero bit to start output. If n is negative, the first character of the output is - . b is greater than a value of less than 37 of any nature. When b = 2, the output character can only be 0 and 1 When b = 16, the output string may contain characters 0 - 9 , a - f (letter in lower output). b may also be other values . For example, enter n = 33, b = 17, the output 17 hex value "1g" 33 s.
[Form] input console input integer n and b, where n can be negative. n and b separated by a space.
[Output format] console output after conversion string s.
Sample input [52]
Sample output] 101
[Descr iption] binary sample 5 is 101
[Standard] results entirely correct score 20 points, 4 points for each test poin
【输入形式】控制台输入整数n和b,其中n可以为负数。n和b以空格分隔.
【输出形式】控制台输出转化后的字符串s.
【样例输入】5 2
【样例输出】101
【样例说明】5的二进制就是101
【评分标准】结果完全正确得20分,每个测试点4分。提交程序名为:itob.c-[Problem Descr iption] Write a function itob (n, s, b), is used to convert the integer n base b string and stored in s. Written procedures, use the function itob (n, s, b) the input integer n, converted to a string s, the s output. strings converted from the highest non-zero bit to start output. If n is negative, the first character of the output is - . b is greater than a value of less than 37 of any nature. When b = 2, the output character can only be 0 and 1 When b = 16, the output string may contain characters 0 - 9 , a - f (letter in lower output). b may also be other values . For example, enter n = 33, b = 17, the output 17 hex value "1g" 33 s.
[Form] input console input integer n and b, where n can be negative. n and b separated by a space.
[Output format] console output after conversion string s.
Sample input [52]
Sample output] 101
[Descr iption] binary sample 5 is 101
[Standard] results entirely correct score 20 points, 4 points for each test poin
(系统自动生成,下载前可以参看下载内容)
下载文件列表
getprimenum/
getprimenum/Debug/
getprimenum/Debug/getprimenum.exe
getprimenum/Debug/getprimenum.ilk
getprimenum/Debug/getprimenum.obj
getprimenum/Debug/getprimenum.pch
getprimenum/Debug/getprimenum.pdb
getprimenum/Debug/itob.exe
getprimenum/Debug/itob.ilk
getprimenum/Debug/itob.obj
getprimenum/Debug/itob.pch
getprimenum/Debug/itob.pdb
getprimenum/Debug/vc60.idb
getprimenum/Debug/vc60.pdb
getprimenum/getprimenum.dsp
getprimenum/getprimenum.dsw
getprimenum/getprimenum.ncb
getprimenum/getprimenum.opt
getprimenum/getprimenum.plg
getprimenum/itob.c
getprimenum/itob.dsp
getprimenum/itob.dsw
getprimenum/itob.ncb
getprimenum/itob.opt
getprimenum/itob.plg
getprimenum/Debug/
getprimenum/Debug/getprimenum.exe
getprimenum/Debug/getprimenum.ilk
getprimenum/Debug/getprimenum.obj
getprimenum/Debug/getprimenum.pch
getprimenum/Debug/getprimenum.pdb
getprimenum/Debug/itob.exe
getprimenum/Debug/itob.ilk
getprimenum/Debug/itob.obj
getprimenum/Debug/itob.pch
getprimenum/Debug/itob.pdb
getprimenum/Debug/vc60.idb
getprimenum/Debug/vc60.pdb
getprimenum/getprimenum.dsp
getprimenum/getprimenum.dsw
getprimenum/getprimenum.ncb
getprimenum/getprimenum.opt
getprimenum/getprimenum.plg
getprimenum/itob.c
getprimenum/itob.dsp
getprimenum/itob.dsw
getprimenum/itob.ncb
getprimenum/itob.opt
getprimenum/itob.plg
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.