#include <stdio.h>
void hello_world(void)
{
printf("Hello, world!\n");
}
void three_hellos(void)
{
int counter;
for (counter = 1; counter <= 3; counter++)
hello_world();
}
void main(void)
{
three_hellos();
getch();
}
有没谁能帮忙一句一句的解释一下啊,谢谢
#include <stdio.h>
void hello_world(void)
{
printf("Hello, world!\n");
}
void three_hellos(void)
{
int counter;
for (counter = 1; counter <= 3; counter++)
hello_world();
}
void main(void)
{
three_hellos();
getch();
}
有没谁能帮忙一句一句的解释一下啊,谢谢
#include <stdio.h> void hello_world(void) { printf("Hello, world!\n"); } void three_hellos(void) { int counter; for (counter = 1; counter <= 3; counter++) hello_world(); } void main(void) { three_hellos(); getch(); }
hello_world函数作用为输出
hello world!
three_hellos函数调用三次hello_world函数,即输出三次hello world!
在main函数中调用three_hellos,作用见上
然后输入任意一个字符结束