| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 390 人关注过本帖
标题:求从杂乱无章的数列中提取非降序数列段的算法
取消只看楼主 加入收藏
黝黑蜗壳
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2014-10-9
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
求从杂乱无章的数列中提取非降序数列段的算法
如题。。。 想了几天也没明白
这是我的算法 但是有问题 不知道问题在哪 还望指教
Private Sub Command1_Click()
'Dim counter As Integer, i As Integer, x As Integer
    Open App.Path & "\数据.txt" For Input As #1
        Do While Not EOF(1)
        Line Input #1, temp
        x = x + 1
        Loop
    Close #1
'Dim sj(60000)
i = 1
    Open App.Path & "\数据.txt" For Input As #2
        While Not EOF(2)
        Input #2, sj(i)
        i = i + 1
        Wend
    Close #2

For counter = 1 To x - 1
    'Select Case sj(counter)
        'Case Is <= sj(counter + 1) And Text1.Text <> ""
            'Text1.Text = Text1.Text & vbNewLine & sj(counter)
            'GoTo end_:
        'Case Is <= sj(counter + 1) And Text1.Text = ""
            'Text1.Text = sj(counter)
            'GoTo end_:
        'Case Is >= sj(counter - 1) And sj(counter) <= sj(counter + 1) And Text1.Text <> ""
           ' Text1.Text = Text1.Text & vbNewLine & sj(counter)
            'GoTo end_:
        'Case Is >= sj(counter - 1) And sj(counter) <= sj(counter + 1) And Text1.Text = ""
            'Text1.Text = sj(counter)
            'GoTo end_:
'end_:
    'End Select
    If sj(counter) <= sj(counter + 1) And Text1.Text <> "" Then
        Text1.Text = Text1.Text & vbNewLine & sj(counter)
    ElseIf sj(counter) <= sj(counter + 1) And Text1.Text = "" Then
        Text1.Text = sj(counter)
    ElseIf sj(counter) >= sj(counter - 1) And sj(counter) <= sj(counter + 1) And Text1.Text <> "" Then
        Text1.Text = Text1.Text & vbNewLine & sj(counter)
    ElseIf sj(counter) >= sj(counter - 1) And sj(counter) <= sj(counter + 1) And Text1.Text = "" Then
        Text1.Text = sj(counter)
    End If
Next
End Sub
搜索更多相关主题的帖子: counter 
2014-10-09 10:48
快速回复:求从杂乱无章的数列中提取非降序数列段的算法
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018522 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved