VB输入任意一个三位数,输出1至该数中能被3和5同时整除的数 程序代码
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/18 12:53:20
privatesubcommand1_click()dimmaxfori=1to3n=val(inputbox("输入第"&i&"个数"))ifn>maxthenmax=nendifnextprint
PrivateSubForm_Click()DimaAsSingle,bAsSingle,cAsSingle,zAsSinglea=InputBox("输入a的值","")b=InputBox("输入
privatesubform_click()dimnaslong,snaslongn=inputbox("请输入n")fori=0tonsn=sn+2*i+1nextmsgbox"1+3+5+...(
PrivateSubCommand1_Click()Dims$,i%,sMax$,sArr$()s=InputBox("任意输入一个英文句子","输入英文","Hello,thisisatestcom
你的程序中判断素数并加和的部分有问题在你的基础上修改如下PS:main不需要改动# include <stdio.h>int SumPrime(int&nbs
#includeintmain(){intn;scanf("%d",&n);do{printf("%d",n%10);}while(n/=10);printf("\n");return0;}
dimarray(),iasinteger,jasintegerdimmin_iasinteger,max_jasinteger'用来标注数组中最小值和最大值的下标redimarray(10)=[1,
#includevoidmain(){inta,b,c,d;scanf("%d",&a);b=a/100;c=(a%100)/10;d=a%10;printf("%d",100*d+10*c+b);}
PrivateSubCommand1_Click()DimaAsInteger,bAsIntegera=Val(InputBox("请输入一个不为0数"))Text1=Abs(1/(a-5))Ifa
#include#includeintmain(){inti,num,n,ans,tt;while(scanf("%d",&num)!=EOF){ans=0;n=3;//如果要求N位数反转,把n改了就
a=InputBox("请输入a")b=InputBox("请输入b")c=InputBox("请输入c")Ifat=aa=bb=tEndIfIfat=aa=cc=tEndIfIfbt=bb=cc=t
#include <stdio.h>int main(void){ int num, i,
Dimn%,cs,i%n=Text1cs="1":i=2DoIfnModi=0Thenn=n/i:cs=cs&"×"&iElsei=i+1EndIfLoopWhileiOptionExplicitPr
PrivateSubForm_Click()DimnAsIntegern=InputBox("请输入一个正整数n")s=1Fori=nTo1Step-1s=s*iNextiPrintn&"!="&sE
a=XXb=YYc=MMifa>bthenmax=aelsemax=bendififc>maxthenmax=cendif
VB内置的常用函数里就有这个功能mid函数:比如你在text1中输入的三位数是123a=text1.texttext2.text=mid(a,1,2)这时输出的字符是1和2,含义是从第一个字符开始的前
#includeintmain(){inta[3];inti;for(i=0;i{scanf("%.1d",&a[i]);}printf("%d\n",a[0]+a[1]+a[2]);return0;
PrivateSubCommand1_Click()DimiAsInteger,jAsInteger,sAsSingle,nAsStringn=InputBox("enterdatan:")Fori=
PrivateSubCommand1_Click()Sum=1Fori=1ToText1.TextSum=Sum*iNextiPrintSumEndSub再问:那在窗体上输出九九乘法表??你会吗??真
#includeintmain(){inti=0;printf("pleaseputanumber:\n->");scanf("%d",&i);while(i){printf("%d\n