单项选择题
有以下程序:
#include <stdio.h>
void f(int n, int *r)
int r1=0;
if (n%3==0) r1=n/3;
else if (n%5==0) r1=n/5;
else f(--n, &r1);
*r=r1;
main()
int m=7, r;
fm, &r); printf("%d\n", r);
程序运行后的输出结果是( )。
A) 2
B) 1
C) 3
D) 0
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序: #include <stdio.h> int fun(int n) if(n==1) return 1; else return(n+fun(n-1) ); main() int x; scanf( %d , &x); x=fun(x); printf( %d n , x); 执行程序时,给变量x输入10,程序的输出结果是( )。
A) 55
B) 54
C) 65
D) 45
点击查看答案&解析
单项选择题
有以下程序: #include <stdio.h> #include <string.h> main() char p[20]='a', 'b', 'c', 'd', q[]= 123 , r[]= 123de ; strcat(p, r); strcpy(p+strlen(q), q); printf( %d n , strlen(p) ); 程序运行后的输出结果是( )。
A) 9
B) 6
C) 11
D) 7
点击查看答案&解析
相关试题
有以下程序: #include <stdio.h> ...
若x=2,y=3,则x&y的结果是( )。
有以下程序: #include<stdio.h> mai...
有以下程序: #include <stdio.h> ...