当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

有以下程序: #include int fun(int n) { if(n)return fun(n-1)+n; else return 0; } main() { printf("%d ",fun(3));} 程序的运行结果是()。


A.4

B.5

C.6

D.7

请帮忙给出正确答案和分析,谢谢!

参考答案
您可能感兴趣的试题
  • (34)有以下程序#include <stdio.h>int fun(){ static int x=1;x*=2;return x;}main(){ int

  • 有以下程序#include <stdio.h>#include <stdlib.h>int fun(int t){ int *p;p=(int*)

  • 有以下程序 #include int fun(int a int b) { if(b==0) return a;

  • 有以下程序: #include<stdio.h> #define N 4 void fun(int a[][N] int[]) { int i;

  • 有以下程序#include<stdio.h>int fun( ){static int x=1;x+=1;return x;}main( ){int i s=

  • 有以下程序 #include int fun(int (*s)[4] int n int k) {int m i;