有这样一个程序,该如何去设计..

chengran1984 2009-07-29 05:31:19
有一个数值是54321,我想让它分开写入一些文本文件中

现有的文本有
5000.txt
4000.txt
3000.txt
2000.txt
1000.txt
900.txt
800.txt
700.txt
600.txt
500.txt
400.txt
300.txt
200.txt
100.txt
90.txt
80.txt
70.txt
.
.
.
10.txt
9.txt
8.txt
.
.
.
1.txt

是不是通过求余数这样?
...全文
95 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
heikeyanxi 2009-07-29
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 veron_04 的回复:]
哦,
dim lngValue as long
dim intW as integer
dim intQ as integer
dim intB as integer
dim intS as integer
dim intG as integer
lngValue=54321
intW=lngValue\10000
intQ=(lngValue mod 10000) \1000
intB=(lngValue-intW*10000-intQ*1000)\100
intS=(lngValue-intW*10000-intQ*1000-intB*100)\10
intG=lngValue mod 10


[/Quote]

貌似是VB代码..
sanguomi 2009-07-29
  • 打赏
  • 举报
回复
没看明白楼主要的规律
oyb330 2009-07-29
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 chengran1984 的回复:]
就是把 54321 这个数字
写入 5000.txt
400.txt
20.txt
1.txt
[/Quote]

还是没看懂规律。。。
为什么没3?
贝隆 2009-07-29
  • 打赏
  • 举报
回复
哦,
dim lngValue as long
dim intW as integer
dim intQ as integer
dim intB as integer
dim intS as integer
dim intG as integer
lngValue=54321
intW=lngValue\10000
intQ=(lngValue mod 10000) \1000
intB=(lngValue-intW*10000-intQ*1000)\100
intS=(lngValue-intW*10000-intQ*1000-intB*100)\10
intG=lngValue mod 10

SuperTitan001 2009-07-29
  • 打赏
  • 举报
回复
用 mod
chengran1984 2009-07-29
  • 打赏
  • 举报
回复
就是把 54321 这个数字
写入 5000.txt
400.txt
20.txt
1.txt
SuperTitan001 2009-07-29
  • 打赏
  • 举报
回复
没看懂意思

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧