❶ vbs写的计算器,本人电脑小白,高手轻喷
#include<stdio.h>
main()
{
char a,b;
int sum;
char reply;
do{
printf("输入a,b:");
scanf("%c,%c",&a,&b);
if(a>=48 && a<=57 && b>=48 && b<=57)
{
sum=((int)(a+b));
printf("a,b和:%d\n",sum);
}
else
{
printf("输入a,b字符错误\2\n");
}
printf("");
scanf("%c",&reply);
}while (reply>=0 && reply<=127);
getch();
}
❷ vbs计算的数字范围是多少
帮你找了下微软的帮助手册,如下。
子类型 描述
Empty 未初始化的 Variant。对于数值变量,值为 0;对于字符串变量,值为零长度字符串 ("")。
Null 不包含任何有效数据的 Variant。
Boolean 包含 True 或 False。
Byte 包含 0 到 255 之间的整数。
Integer 包含 -32,768 到 32,767 之间的整数。
Currency -922,337,203,685,477.5808 到 922,337,203,685,477.5807。
Long 包含 -2,147,483,648 到 2,147,483,647 之间的整数。
Single 包含单精度浮点数,负数范围从 -3.402823E38 到 -1.401298E-45,正数范围从 1.401298E-45 到 3.402823E38。
Double 包含双精度浮点数,负数范围从 -1.79769313486232E308 到 -4.94065645841247E-324,正数范围从 4.94065645841247E-324 到 1.79769313486232E308。
Date (Time) 包含表示日期的数字,日期范围从公元 100 年 1 月 1 日到公元 9999 年 12 月 31 日。
String 包含变长字符串,最大长度可为 20 亿个字符。
Object 包含对象。
Error 包含错误号。
❸ 怎样用VBS算圆周
你是说算圆周率吗?下面是从从C语言转移过来的,不过速度太慢,我这里运行了8分钟还没结束,我就直接结束它啦,你自己试试吧
dim a,b,c,d,e,f(2801),g
a=10000
c=2800
do while (b-c)
f(b=b+1)=a/5
loop
do while d=0 and g=c*2
b=c
d=d+f(b)*a
g=g-1
f(b)=d mod g
d=d/g
g=g-1
do while b=b-1
d=d*b
d=d+f(b)*a
g=g-1
f(b)=d mod g
d=d/g
g=g-1
loop
c=c-14
msgbox e+d/a
e=d mod a
loop
❹ VBS 简单计算题,高手来,速度解决来。。。
Set fso = CreateObject("Scripting.FileSystemObject")
set o =fso.createtextfile("1.txt",true)
for a= 0 to 8
for b= 0 to 8
for c= 0 to 8
s=a+b+c
if s<13 then
o.writeline a&" "&b&" "&c
end if
next
next
next
o.Close
❺ 求一个计算时间差的VBS脚本
FunctionCheckExpire(strDateStart,iExpireTime)'#检验是否过期函数
OnErrorResumenext
CheckExpire=False
IfDateDiff("d",CDate(strDateStart),Date)>=iExpireTimeThen'#如果当前日期减去第一次运行的日期超过设定的天数则
CheckExpire=True
Endif
EndFunction
OnErrorResumenext
DimiExpireTime
iExpireTime=30'#过期时间为30天
DimoShell,DateStart
SetoShell=CreateObject("WScript.Shell")
DateStart=oShell.RegRead("HKLMSOFTWARECompanyKeyValue")
IfDateStart=""Then'#如果读取到的值为空,说明是第一次运行
WScript.Echo"第一次"
oShell.RegWrite"HKLMSOFTWARECompanyKeyValue",Date()
EndIf
IfDateStart=""OrNotCheckExpire(DateStart,iExpireTime)Then
WScript.Echo"尚未过期"
Else
WScript.Echo"已过期"
WScript.Quit
EndIf
如果不懂,可以网络HI我。
❻ 用VBScript编写一个计算1~100的和的函数,并给出通过该函数调用打印和值的方法
script type="text/vbscript">
dim i a integer
dim m as integer
m=0
for i=1 to 100
m=m+i
next
document.write("1 to 100 sum:" & str(m));
</script>
❼ VBS 计算器
http://hi..com/jin%5Fmz/blog/item/fb99267a6f669cec2f73b332.html
看看这个是不是你要的答案
❽ 编程,vbs计算求和
n趋近于无穷大,很明显不可能让计算机循环无限次。
所以要依赖推公式得出答案,等待其他人解吧,我试了几种推导法都不行。
❾ vbs脚本能自动计算吗
msgbox 3*75一般运算都可以这样写,比如(6+5)*(2-4)+3,那么可以直接写成msgbox ((6+5)*(2-4)+3)。加减乘除运算是没问题的,不过对于一些复杂的科学运算,那么可能需要相应变通。。。。
❿ vbs循环语句计算
Dimi,sum
sum=0
fori=1to100
sum=sum+i
nextmsgboxsum