#1549. 函数基础2
函数基础2
1、下列说法正确的是( )。 {{ select(1) }}
- 调用有参函数时,不能使用表达式作为参数
 - 定义有参函数时,参数只能是同一种类型
 - C++函数可以同时返回多个返回值
 - 包含有多个函数的程序在运行时,首先会执行主函数 main()
 
2、下列函数定义正确的是( )。 {{ select(2) }}
- 
void star() { cout << "*"; return 0; } - 
int a_3(int a) { return a * a * a; } - 
char nihao() { return 'nihao'; } - 
double avg(int sum, int n) { return cout << sum / n; } 
3、运行程序,输出结果为( )。
void star(int n)
{
    for (int i = 1; i <= n; i++)
    {
        cout << "*";
    }
}
int main()
{
    for (int i = 1; i <= 5; i++)
    {
        star(i);
        cout << endl;
    }
    return 0;
}
{{ select(3) }}
- 
* ** *** **** ***** - 
* ** *** **** ***** - 
***** ***** ***** ***** ***** - 
***** **** *** ** *