博客
关于我
实例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/

你可能感兴趣的文章
Nginx
查看>>
nginx + etcd 动态负载均衡实践(三)—— 基于nginx-upsync-module实现
查看>>
nginx + etcd 动态负载均衡实践(二)—— 组件安装
查看>>
nginx + etcd 动态负载均衡实践(四)—— 基于confd实现
查看>>
Nginx + Spring Boot 实现负载均衡
查看>>
Nginx + uWSGI + Flask + Vhost
查看>>
Nginx - Header详解
查看>>
Nginx - 反向代理、负载均衡、动静分离、底层原理(案例实战分析)
查看>>
nginx 1.24.0 安装nginx最新稳定版
查看>>
nginx 301 永久重定向
查看>>
nginx css,js合并插件,淘宝nginx合并js,css插件
查看>>
Nginx gateway集群和动态网关
查看>>
Nginx Location配置总结
查看>>
Nginx log文件写入失败?log文件权限设置问题
查看>>
Nginx Lua install
查看>>
nginx net::ERR_ABORTED 403 (Forbidden)
查看>>
Nginx SSL私有证书自签,且反代80端口
查看>>
Nginx upstream性能优化
查看>>
Nginx 中解决跨域问题
查看>>
nginx 代理解决跨域
查看>>