永发信息网

C语言考试题不明白

答案:6  悬赏:30  手机版
解决时间 2021-02-05 22:06
C语言考试题不明白
最佳答案
%d 有符号十进制数 %0 八进制 %x 十六进制
格式输出 八进制和十六进制 是没有负数的 所以实际输出的是将 -2 转化为二进制 (补码) 再转化为 十进制数
全部回答
在16位的环境下,应该是(C),如果是32位没有答案。
%d int 有符号的十进制数
%o int 无符号的八进制数
%x int 无符号的十六进制数
%u int 无符号的十进制数
更详细的,你可以通过MSDN获得:
Character Type Output format
c int or wint_t When used with printf functions, specifies a single-byte character; when used with wprintf functions, specifies a wide character.
C int or wint_t When used with printf functions, specifies a wide character; when used with wprintf functions, specifies a single-byte character.
d int Signed decimal integer.
i int Signed decimal integer.
o int Unsigned octal integer.
u int Unsigned decimal integer.
x int Unsigned hexadecimal integer, using "abcdef."
X int Unsigned hexadecimal integer, using "ABCDEF."
e double Signed value having the form [ – ]d.dddd e [sign]ddd where d is a single decimal digit, dddd is one or more decimal digits, ddd is exactly three decimal digits, and sign is + or –.
E double Identical to the e format except that E rather than e introduces the exponent.
f double Signed value having the form [ – ]dddd.dddd, where dddd is one or more decimal digits. The number of digits before the decimal point depends on the magnitude of the number, and the number of digits after the decimal point depends on the requested precision.
g double Signed value printed in f or e format, whichever is more compact for the given value and precision. The e format is used only when the exponent of the value is less than –4 or greater than or equal to the precision argument. Trailing zeros are truncated, and the decimal point appears only if one or more digits follow it.
G double Identical to the g format, except that E, rather than e, introduces the exponent (where appropriate).
n Pointer to integer Number of characters successfully written so far to the stream or buffer; this value is stored in the integer whose address is given as the argument.
p Pointer to void Prints the address of the argument in hexadecimal digits.
s String When used with printf functions, specifies a single-byte–character string; when used with wprintf functions, specifies a wide-character string. Characters are printed up to the first null character or until the precision value is reached.
S String When used with printf functions, specifies a wide-character string; when used with wprintf functions, specifies a single-byte–character string. Characters are printed up to the first null character or until the precision value is reached.

参考资料:MSDN

b鏄痷nsigned鍨嬫暟鎹?紝涓嶈兘鏄?礋鏁帮紝瀹幂殑鍙栧€艰寖锲存槸0~65535銆
%鏄?浆涔夊瓧绗》殑鍓岖紑锛屼篃灏辨槸璇村彧瑕丆绯荤粺瑙勫畾镄勮浆涔夊瓧绗】紝鍓嶉溃閮芥湁涓€涓?鍙枫€傛瘮濡?d锛屽氨鏄?〃绀轰互鍗佽繘鍒舵暣鍨嬫暟鎹?緭鍑烘垨钥呰緭鍏ャ€?x琛ㄧず浠?6杩涘埗銆?o琛ㄧず浠ュ叓杩涘埗杈揿叆鎴栬€呰緭鍑恒€
濡傛灉灏哹瀹氢箟涓篿nt鍨嬶紝灏变笉浼氩彂鐢熸暟鎹?孩鍑猴紝濡傦细
int b=a;
奶油葡萄 -已经回答
我想说的是,记得谭老妖的C语言书里有一个列表!自己为什么不看书?
%d,%o,%x
如果我没有记错的话,应该是请以十进制,16进制,8进制分别输出的意思
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
伐板基础板筋是焊接还是绑扎
微信好友上没有来源显示,怎么添加?原因是什
请问 吕婷华是同性恋吗 看她QQ空间都是和一个
希捷有一款酷玩 固态混合3.5寸硬盘,不知道性
3分米-8厘米=()厘米
cf登录不上去
南美风格的水草置景如何布置?
我18男的和一个30多岁的姐姐约了一次。。那是
自己不想要,但又不想给别人,这是什么心态
本人所在的陶瓷厂于本月15号停产并倒闭。拖欠
正道金服是否可以换注册的手机账号?我投资的
翻译:Linda _______ (不可能收到了我的电子
《新白娘子传奇》第一集唱到 救苦救难观世音
K287列车3车厢98是否靠窗
我对陌生女生说我想被美女打打耳光,她会怎样
推荐资讯
什么是实木皮?什么材质?怎么形成?
深圳观澜到深圳福永公交车是几路和在哪坐
dtech usb转串口怎么用
在课间和男生玩泼水游戏,老师让写检讨,请问检
复数运算里(1+i)^2等于正负2i吗
人不可能一辈子都在浪口顶上,也会有低潮的时
潘之琳在金太郎的幸福生活中饰演什么角色
绿箭侠与他的前女友Laurel Lance最后怎么了?
郑州市金水区行政审批中心能办理机动车驾驶证
电脑主机装散热风扇,是风扇进风好,还是出风
欧洲足球八大豪门有哪些?国米算么?
单片机write(fd,a,10);什么 意思
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?