#include <stdio.h>
#include <stdlib.h>
void delay(int i)
{
for (i = 0; i <= 5000; i++);
}
void buyrice1() //无形式参数(去买米,不关心买多少斤) 无返回值(不关心买回米没有)
{
printf("去买米********\n");
}
void buyrice2(int jishu) //jishu是形式参数,类似变量的定义
{
printf("去买%d斤米*******\n",jishu);
}
int main()
{
int a = 50;
int b = 100;
buyrice1();
buyrice2(a); //调用的函数又参数,必须传值.传递的参数较实际参数,对数据的类型有严格要求.
buyrice2(b);
system("pause");
return 0;
}
函数的无返回无参数,无返回带一个参数,传参
于 2022-09-08 21:19:26 首次发布