liuzhiming69的个人博客分享 http://blog.sciencenet.cn/u/liuzhiming69

博文

1/x+1/y=2/3计算程序

已有 106 次阅读 2025-12-20 06:53 |系统分类:科研笔记

程序:

Private Sub CommandButton1_Click()

Dim x As Integer

Dim y As Integer

x = 1

y = 1

l = 2

With Sheet1

.Cells.Clear

.Cells(1, 1) = "x"

.Cells(1, 2) = "y"

For x = 1 To 100

For y = 1 To 100

If 1 / x + 1 / y = 2 / 3 Then

.Cells(l, 1) = x

.Cells(l, 2) = y

l = l + 1

End If

Next y

Next x

End With

End Sub

计算结果:

x y

2 6

3 3

6 2



https://blog.sciencenet.cn/blog-3556836-1515076.html

上一篇:1+x^2=2^y的正整数解
收藏 IP: 106.114.11.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2025-12-20 11:47

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部