0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

vbsの作法 その103

Posted at

概要

vbsの作法、調べてみた。
練習問題やってみた。

練習問題

vbsで、関数電卓を書け。

サンプルコード


a = 3
pi = 3.14
Do
	WScript.StdOut.Write "数式を入力してください:"
	strExpr = Wscript.StdIn.ReadLine
	If strExpr = "" Then Exit Do
	WScript.StdOut.WriteLine "計算結果:" & strExpr & " = " & Eval(strExpr)
Loop



実行結果

>cscript den.vbs
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

数式を入力してください:pi
計算結果:pi = 3.14
数式を入力してください:sin(2 * pi)
計算結果:sin(2 * pi) = -3.18530179313799E-03
数式を入力してください:sin(pi /2 )
計算結果:sin(pi /2 ) = 0.999999682931835
数式を入力してください:

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?