高一数学编写程序,计算s=a aa aaa aaaa aaaaa
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 07:09:31
inta,n;doublesum=0;scanf("%d%d",&a,&n);for(sum=a,i=2;i
s=0k=1whilei
INPUT"a=";aINPUT"n=";ntn=0sn=0i=1WHILEi
要写的话太麻烦了.我就告诉你基本思路吧数字a没关系但是个数n的话,s=0个位有n个as=s+na十位有n-1个as=s+10(n-1)a百位有n-2个as=s+100(n-2)a千位有n-3个a一直做
DimaAsInteger,nAsInteger,iAsInteger,sAsDoublea=Val(InputBox("a=?"))n=Val(InputBox("n=?"))Ifa>0And
inputa,ni=0m=0s=0DOb=10^im=a*b+ms=s+mi=i+1LOOPUNTILi>=nprintsend童鞋你不会是八中的吧.同一天同一道题.求班级,我就只给你一种解法吧再问:
VB程序PrivateSubCommand1_Click()Dima,iAsIntegeri=1Whilei<50s=s+(i+1)/ii=i+1WendPrint"s=";sEndSu
voidmain(){inta,n,i;inttemp,s;scanf("%d%d",&a,&n);if(a9||n
#includeintfn(inta,intn);intmain(){inta,n,m,sum;printf("请分别输入a和n,用空格分开");scanf("%d%d",&a,&n);m=n+1,s
用你那个问题的格式:reada,nt←as←0forifrom1tons←s+tt←t*10+aendforprintsend
#include#includeintmain(){doubled;scanf("%lf",&d);printf("|y|=%.2lf\n",fabs(d));return0;}
LZ不给分加一下最佳总可以吧?注意是BASIC不是BUSICinputa,ni=1s=0dos=s+aa=a+a*10^ii=i+1whilei
#include"stdio.h"main(){longa,i,p,s,N;printf("请输入a值:\n");scanf("%ld",&a);printf("请输入a小于等于:\n");scanf
inti,S=0;for(i=1;i
我用php语言写的.分两个步骤,一个是计算每个节点的值,用递归算法.一个是节点的累加,用循环算法.这么好的答案,不给分,没良心.再问:谢谢了,我没说清楚,我现在学的是c++语言,真的很感谢
publicclassTest{publicstaticvoidmain(String[]args){ints=0;intn=1;for(inti=0;i
;MOVAX,AANDAX,B;AX=aANDbMOVBX,AXORBX,B;BX=aXORbADDAX,BXADDAX,BX;AX=2*(aXORb)+aANDbADDAX,A;AX=a+2*(aX
CLEARSETTALKOffs1=0forn=1to10s1=s1+jc(n)next"1!+2!+3!+.+10!=",s1FUNCTIONjcPARAMETERSis=1FORj=1TOis=s
这是c++程序的源代码,我已经运行过了,准确无误#includeusingnamespacestd;intmain(){inta,n,u,sum;coutn;u=sum=a;cout
#includeintmain(){inti,s=0;for(i=1;i