C语言中PRINT("% ,% ",A,B);中%后可以加哪几种数据类型,符号及含义,
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/08/24 06:14:37
C语言中PRINT("% ,% ",A,B);中%后可以加哪几种数据类型,符号及含义,
C语言中PRINT("% ,% ",A,B);中%后可以加哪几种数据类型,符号及含义,
C语言中PRINT("% ,% ",A,B);中%后可以加哪几种数据类型,符号及含义,
c官方文档有很详细的解释
Output Example
d or i Signed decimal integer 有符号10进制整型 392
u Unsigned decimal integer 无符号10进制整型 7235
o Unsigned octal 无符号8进制整型 610
x Unsigned hexadecimal integer 无符号16 7fa
X Unsigned hexadecimal integer (uppercase) 7FA
f Decimal floating point, lowercase 10进制浮点小数 392.65
F Decimal floating point, uppercase 392.65
e Scientific notation (mantissa/exponent), lowercase 科学计数法 3.9265e+2
E Scientific notation (mantissa/exponent), uppercase 3.9265E+2
g Use the shortest representation: %e or %f 最短表达 392.65
G Use the shortest representation: %E or %F 392.65
a Hexadecimal floating point, lowercase 16进制浮点小数 -0xc.90fep-2
A Hexadecimal floating point, uppercase -0XC.90FEP-2
c Character 字符 a
s String of characters 字符串 sample
p Pointer address 指针地址 b8000000
n Nothing printed.
The corresponding argument must be a pointer to a signed int.
The number of characters written so far is stored in the pointed location.
% A % followed by another % character will write a single % to the stream. %
再问: 真心感谢
再答: 没有其他问题的话,麻烦您采纳可以吗?
Output Example
d or i Signed decimal integer 有符号10进制整型 392
u Unsigned decimal integer 无符号10进制整型 7235
o Unsigned octal 无符号8进制整型 610
x Unsigned hexadecimal integer 无符号16 7fa
X Unsigned hexadecimal integer (uppercase) 7FA
f Decimal floating point, lowercase 10进制浮点小数 392.65
F Decimal floating point, uppercase 392.65
e Scientific notation (mantissa/exponent), lowercase 科学计数法 3.9265e+2
E Scientific notation (mantissa/exponent), uppercase 3.9265E+2
g Use the shortest representation: %e or %f 最短表达 392.65
G Use the shortest representation: %E or %F 392.65
a Hexadecimal floating point, lowercase 16进制浮点小数 -0xc.90fep-2
A Hexadecimal floating point, uppercase -0XC.90FEP-2
c Character 字符 a
s String of characters 字符串 sample
p Pointer address 指针地址 b8000000
n Nothing printed.
The corresponding argument must be a pointer to a signed int.
The number of characters written so far is stored in the pointed location.
% A % followed by another % character will write a single % to the stream. %
再问: 真心感谢
再答: 没有其他问题的话,麻烦您采纳可以吗?