哪里有問題??
#include?<stdio.h> /*?考慮一下哪個輸出該用無參函數哪個輸出該用有參函數呢??*/ int?test1() { ????printf("%s\n","小明在慕課網上學習"); ????return?0; } int?test2(int?n) { ????printf("小明在慕課網上學習了%d門課程",n); ????return?0; } int?main() { ????test1(); ????test2(5); ????return?0; }
#include?<stdio.h> /*?考慮一下哪個輸出該用無參函數哪個輸出該用有參函數呢??*/ int?test1() { ????printf("%s\n","小明在慕課網上學習"); ????return?0; } int?test2(int?n) { ????printf("小明在慕課網上學習了%d門課程",n); ????return?0; } int?main() { ????test1(); ????test2(5); ????return?0; }
2020-02-27
舉報
2020-02-27
test2里的n沒有定義,int test2(int n)這里是參數,不是定義
2020-02-29
?
printf
(
"小明在慕課網上學習了%d門課程"
,n);這里的逗號錯了
2020-02-28
#include <stdio.h>
/* 考慮一下哪個輸出該用無參函數哪個輸出該用有參函數呢? */
int test1()
{
? ? printf("%s\n","小明在慕課網上學習");
? ? return 0;
}
int test2(int n)
{
? ? printf("小明在慕課網上學習了%d門課程",n);
? ? return 0;
}
int main()
{
? ? test1();
? ? test2(5);
? ? return 0;
}