#include int main(){ int y=9;for(;y>0;y- -)if(y%3==0){ printf(%d”,- -y);}return 0;}运行结果为:
查看答案
#include int main(){ float fun(float x[]);float ave,a[3]={4.5,2,4};ave=fun(a);printf(“ave=%7.2f”,ave);return 0;}float fun(float x[]){int j;float aver=1;for (j=0;j<3;j++)aver=x[j]*aver;return(aver);}运行结果为:
#include f(int b[],int n){int i,r;r=1;for (i=0;i<=n;i++)r=r*b[i];return (r);}int main(){int x,a[]={1,2,3,4,5,6,7,8,9};x=f(a,3);printf(“%d\n”,x);return 0;}运行结果为:
#include void func(int x) {x=10;printf(“%d, ”,x);}int main( ){ int x=20;func(x);printf(“%d”, x);return 0;}运行结果为:
#include int fun2(int a, int b){ int c;c=(a*b)%3;return c;}int fun1(int a, int b){ int c;a+=a;b+=b;c=fun2(a,b);return c*c;}int main(){int x=4,y=5;printf("%d\n",fun1(x,y));return 0;}运行结果为: