求助,我刚学函数,我不明白这为啥运行不了
#include <stdio.h>void function()
{
int age = 0;
printf("请输入你的年龄: ");
scanf("%d", &age); `
printf("你的年龄是:%d\n", age);
}
int main()
{
function();
return 0;
}
程序代码:#include <stdio.h>
void function()
{
int age = 0;
printf("请输入你的年龄: "); // 用printf输出提示信息
scanf("%d", &age); // scanf只写格式控制符
printf("你的年龄是:%d\n", age);
}
int main()
{
function();
return 0;
}[此贴子已经被作者于2025-11-13 20:03编辑过]
