2.反思

9月27

练习2

1.sizeof( ?)求字节\\例:printf("sdasdad",sizeof(?));

#include<stdio.h>

using namespace std;

int main()

{

printf ("The size of short is %d bytes.\n",sizeof(short));

printf ("The size of int is %d bytes.\n",sizeof(int));

printf ("The size of long is %d bytes.\n",sizeof(long));

printf ("The size of long long is %d bytes.\n",sizeof(long long));

return 0;

}

2.#控制前导显示\\例:printf("%#o",a);

3.%o:16进制 %X:8进制

4.输出整数:printf("%d",0xABCD); 问:为什么这里用0数字而不是o字母?

5.字符用cahr printf 用%c

全部评论

相关推荐

2024-12-20 18:56
已编辑
武汉轻工大学 后端
牛牛大啊:er图都冒出来了😂
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务