猿问

error C2065: 'getage' : undeclared identifier


#include "stdio.h"

 int getage(n)

{

int age;

if (n==1)

     age=10;

else

age=(getage(n-1))+2;

return age;

}

int main()

{

int fifthage=(getage(5));

printf("第五个人是%d岁\n",fifthage);

return 0;

}


慕粉2022576021
浏览 1164回答 1
1回答

慕粉2022576021

getage(int n)
随时随地看视频慕课网APP
我要回答