编写函数fun求[1,m]偶数之积
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 13:54:43
intfun(intn){inta=n,b=0;while(a>0){b=b*10;b=b+a%10;a=a/10;}printf("%d",b);getch();return0;}或者把后三行删掉,
floatfun(intm){ inti,j,count,iszishu; floatsum; &
intfun(intn){intm=1,sum=0,i,j;for(i=1;i
PrivateSubfun()ifimod2=0thenforx=itoastep2s=s*xnextxelseforx=(i+1)toastep2thens=s*xnextxendif试试看行不行吧
fun(intk){if(k%2==0)return0;elsereturn1;}再问:这个打进去就直接可以出结果的吗?我是电大的考试题,有8分呢,这么一点够吗再答:嗯,在fun前面加个int
voidfun(intm,int*k,intxx[]){inti,j=0;*k=0;for(i=2;i
上面的错了应该是intfun(){inti,sum=1;for(i=1;i
#include#includevoidswap(intc[],intlen){inti=0;inttmp;for(;i{tmp=c[i];c[i]=c[len];c[len]=tmp;}}intmu
#includeinta[50];intfun(intm){intn=0;for(inti=1;i
Functionsum(n)AsDoublesum=0Fori=1TonIfiMod2=0Thensum=sum+i*iNextEndFunction
Functions(ByValaAsInteger,ByValbAsInteger)AsIntegerDimiAsIntegerFori=1To1000IfiModa=0AndiModb=0Thens
#includemain(){longintn,i,j,k;doublem;printf("请输入数字'n':");scanf("%d",&n);if(n%2==1){for(i=0;i0){for(
#include#include#includeintisprime(intn){inti;for(i=2;i
#include"stdio.h"intgetsum(inta,intb)//要声明a,b为int型{inti;intsum=0;for(a%2==0?i=a:i=a+1;sum=sum+i;i+=2
#include#includedoublefun(intn)//计算1!+2!+3!+.+n!,并赋值给fun{inti;doubles=0,t=1;for(i=1;i
用这肯定可以intfun(intm){for(inti=m-1;i>1;i--){intj;booleanisPrime=true;for(j=2;jif(i%j==0){isPrime=false;
#includeusingnamespacestd;longunsignedfun(intn){if(n>1)returnn*fun(n-1);return1;}voidmain(){intn;cou
#include#includefloatfun(inta,intb){floatc;c=sqrt(a)+sqrt(b);returnc;}intmain(){inta=12,b=20;floatc;
/*Note:YourchoiceisCIDE*/#include"stdio.h"voidmain(){intfun(inta[50][50],intm,intn);intm,n,i,j,a[50]
functionfun(d,h){if(d