博客
关于我
实例002变量的数学运算(2)
阅读量:194 次
发布时间:2019-02-28

本文共 711 字,大约阅读时间需要 2 分钟。

创建一个控制台程序

Module Module1

    Sub Main()

        Dim x1 As Double, x2 As Double
        Dim y1 As Double

        Console.WriteLine("输入两个数,计算x1的x2次方")

        x1 = InputBox("输入x1", "乘方运算的底数")
        x2 = InputBox("输入x2", "乘方运算的指数")
        y1 = Math.Pow(x1, x2)
        MsgBox(y1, MsgBoxStyle.Information, "乘方运算结果")

        Console.WriteLine("输入两个数,计算以x1为底,以x2为指数")

        x1 = InputBox("输入x1", "对数运算的底数")
        x2 = InputBox("输入x2", "对数运算的真数")
        y1 = Math.Log(x2) / Math.Log(x1)
        MsgBox(y1, MsgBoxStyle.Information, "对数运算结果")

        x1 = InputBox("输入一个数", "求绝对值")

        y1 = Math.Abs(x1)
        MsgBox(y1, MsgBoxStyle.Information, "对绝对值")

        Console.WriteLine("输入一个数,计算大于该数的最小整数")

        x1 = InputBox("输入一个数", "计算大于该数的最小整数")
        y1 = Math.Ceiling(x1)
        MsgBox(y1, MsgBoxStyle.Information, "计算结果")

        Console.Read()

    End Sub

End Module

 

转载地址:http://jwgn.baihongyu.com/

你可能感兴趣的文章
MySQL8修改密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
查看>>
MySQL8修改密码的方法
查看>>
Mysql8在Centos上安装后忘记root密码如何重新设置
查看>>
Mysql8在Windows上离线安装时忘记root密码
查看>>
MySQL8找不到my.ini配置文件以及报sql_mode=only_full_group_by解决方案
查看>>
mysql8的安装与卸载
查看>>
MySQL8,体验不一样的安装方式!
查看>>
MySQL: Host '127.0.0.1' is not allowed to connect to this MySQL server
查看>>
Mysql: 对换(替换)两条记录的同一个字段值
查看>>
mysql:Can‘t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock‘解决方法
查看>>
MYSQL:基础——3N范式的表结构设计
查看>>
MYSQL:基础——触发器
查看>>
Mysql:连接报错“closing inbound before receiving peer‘s close_notify”
查看>>
mysqlbinlog报错unknown variable ‘default-character-set=utf8mb4‘
查看>>
mysqldump 参数--lock-tables浅析
查看>>
mysqldump 导出中文乱码
查看>>
mysqldump 导出数据库中每张表的前n条
查看>>
mysqldump: Got error: 1044: Access denied for user ‘xx’@’xx’ to database ‘xx’ when using LOCK TABLES
查看>>
Mysqldump参数大全(参数来源于mysql5.5.19源码)
查看>>
mysqldump备份时忽略某些表
查看>>