如题所述
那个我刚学编程,你能写详细点吗
那个fun函数已经写得够详细了,就这些内容main函数就写那一句话就行#inculdeusing namespace std;//上面是引用部分void main(){ cout<<fun(5)<<endl; }如果要求那个数可以变化,就定义一变量算即可void main(){ int x=5; cout<<fun(x)<<endl;}
好的