ksdf.net
当前位置:首页>>关于请编写函数fun,的功能是:求出1到n(n<1000)之内...的资料>>

请编写函数fun,的功能是:求出1到n(n<1000)之内...

void fun(int *a,int *n) { int i, j, k; *n = 0; for (i=1,j=1,k=1; i

void fun(int *a,int n,int *k) { int i,j=0; *k=0; for(i=1;i

你的这一句后面多了一个分号,把它删除就可以了: for(i=1;i

Private Function fun(n As Integer) As IntegerDim i As IntegerFor i = 1 To n fun = fun + i ^ 2Next iEnd Function或 Private Function fun(n As Integer) As IntegerIf n > 0 Then fun = n ^ 2 + fun(n - 1)End Function第二种方法使用了递...

#includevoid fun(int m,int n) { int i,s=0; for ( i=1;i

#include int fun (int a[]){int index = 0;for (int k = 0 ; k < 1000 ; k++ ){if(k%7==0)if(k%11!=0)a[index++]=k;if(k%11==0)if(k%7!=0)a[index++]=k;}return index;}int main( ){ int aa[1000], n, k ; n = fun ( aa ) ; for ( k = 0 ; k < ...

#include int fun(int M, int a[]) { int n = 0; int i; for (i = 1; i < M; ++i) { if (i%7==0 ||i%11==0) { a[n] = i; n++; } } return n; } int main(void) { int n; int count; int a[100]; int i; printf("Input M:"); scanf(" %d", &n); c...

int fun(int n) { int sum=0,i; for ( i=1;i

int fun(int a,int b) {int m,i=0,n[80]; for(m=a;m<=b;m++) {if ((m/7==0&&m/11!=0)‖(m/7!=0&&m/11==0)) {n[i]=m; i++;} } printf(“%d”,i) }

如图

网站首页 | 网站地图
All rights reserved Powered by www.ksdf.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com