16. 读入并格式化输出
语法讲解
今天学: 可以把读入的值嵌入到格式化字符串中。
#include <stdio.h>
int main(void)
{
int age;
scanf("%d", &age);
printf("I am %d years old\n", age);
return 0;
}
小练习
如果输入 12,输出是什么?
输入: 12
提交要求: 只提交最终输出结果,不要添加多余的说明或引号。
今天学: 可以把读入的值嵌入到格式化字符串中。
#include <stdio.h>
int main(void)
{
int age;
scanf("%d", &age);
printf("I am %d years old\n", age);
return 0;
}
如果输入 12,输出是什么?
输入: 12
提交要求: 只提交最终输出结果,不要添加多余的说明或引号。
全部评论