Files
workspace/org/CQuestion.org
e2hang ebcee63b7c New
2026-01-09 00:05:37 +08:00

25 lines
548 B
Org Mode
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
* C Q1
** Recursion
#+begin_src C: result output
#include <stdio.h>
double ave(int a[], int k){
if( /*填空1*/) return 0;
return ave(/*填空2注意只有左括号右边随便写*/
}
int main(){
int n;
scanf("%d", &n);
int* a = (int*)malloc(n * sizeof(int));
.../* 省略输入a[]的过程 */
printf("%.2lf", ave(a, n));
}
输入格式:两行
``` 4
1 2 3 4
输出格式:一行,输出平均值,保留两位小数
``` 2.50
#+end_src