| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3661 人关注过本帖
标题:一组5000个学生考试等级,总共10个科目,查找出考试等级满足3A5B1C的学生名 ...
只看楼主 加入收藏
hguyy
Rank: 2
等 级:论坛游民
帖 子:56
专家分:20
注 册:2016-1-25
结帖率:83.33%
收藏
已结贴  问题点数:20 回复次数:16 
一组5000个学生考试等级,总共10个科目,查找出考试等级满足3A5B1C的学生名单,请问怎么查找?
如题,查找出只有一科C,三科以上A,其他为B的学生,请问VFP如何实现?
搜索更多相关主题的帖子: 如何 如何 
2016-02-29 23:41
hguyy
Rank: 2
等 级:论坛游民
帖 子:56
专家分:20
注 册:2016-1-25
收藏
得分:0 
是9个科目
2016-02-29 23:42
sdta
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:江苏省连云港市
等 级:版主
威 望:335
帖 子:9841
专家分:27213
注 册:2012-2-5
收藏
得分:5 
上传数据表看看

坚守VFP最后的阵地
2016-03-01 00:08
hguyy
Rank: 2
等 级:论坛游民
帖 子:56
专家分:20
注 册:2016-1-25
收藏
得分:0 
回复 3楼 sdta
CDDAABAAA
CDDACDBBC
DDDBDDDDC
BBDABBBBB
CDDADDCDD
CDDACDABA
CDDBDDBDB
CDDADCCCB
BCDAAABBB
DDDBDDDBC
DBDBCDDDC
BDDACDBAB
DDCBDDDDC
BDDBDDCDD
CDDBDDCCB
BBAABBBAA
BDDABBAAB
DDDACCCDC
BBAABBBBA
BBBABBABB
DBDAABBAA
BBDBCBBBB
BBBAABCAA
CDDABBCBB
。。。
。。。
。。。
。。。
总共有5000多条,要筛选出满足条件的人,并另存为一张表。大神,能否帮我啊

2016-03-01 00:23
hguyy
Rank: 2
等 级:论坛游民
帖 子:56
专家分:20
注 册:2016-1-25
收藏
得分:0 
不能有D,只能有1科C,最多5科B,其他为A
2016-03-01 00:24
sdta
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:江苏省连云港市
等 级:版主
威 望:335
帖 子:9841
专家分:27213
注 册:2012-2-5
收藏
得分:0 
程序代码:
CREATE CURSOR TT (CJ C(9),结果 C(10))
INSERT INTO TT(CJ) VALUES ("CDDAABAAA")
INSERT INTO TT(CJ) VALUES ("CDDACDBBC")
INSERT INTO TT(CJ) VALUES ("DDDBDDDDC")
INSERT INTO TT(CJ) VALUES ("BBDABBBBB")
INSERT INTO TT(CJ) VALUES ("CDDADDCDD")
INSERT INTO TT(CJ) VALUES ("CDDACDABA")
INSERT INTO TT(CJ) VALUES ("CDDBDDBDB")
INSERT INTO TT(CJ) VALUES ("CDDADCCCB")
INSERT INTO TT(CJ) VALUES ("BCDAAABBB")
INSERT INTO TT(CJ) VALUES ("DDDBDDDBC")
INSERT INTO TT(CJ) VALUES ("ABABBCBBA")
LOCAL TJ[4]

SCAN
    TJ=0
    FOR I=1 TO 9
        CC=SUBSTR(CJ,I,1)
        DO CASE
            CASE CC="A"
                 TJ[1]=TJ[1]+1
            CASE CC="B"
                 TJ[2]=TJ[2]+1
            CASE CC="C"
                 TJ[3]=TJ[3]+1
            CASE CC="D"
                 TJ[4]=TJ[4]+1
        ENDCASE
    ENDFOR
    REPLACE 结果 WITH IIF(TJ[1]>0,STR(TJ[1],1)+"A","");
    +IIF(TJ[2]>0,STR(TJ[2],1)+"B","");
    +IIF(TJ[3]>0,STR(TJ[3],1)+"C","");
    +IIF(TJ[4]>0,STR(TJ[4],1)+"D","")
ENDSCAN
*BROWSE
*查询结果
SELECT * FROM TT WHERE ALLTRIM(结果)=="3A5B1C" INTO CURSOR JG
BROWSE

坚守VFP最后的阵地
2016-03-01 01:04
hguyy
Rank: 2
等 级:论坛游民
帖 子:56
专家分:20
注 册:2016-1-25
收藏
得分:0 
回复 6楼 sdta
大神,谢谢!让我怎么谢谢您,怎么联系您?
2016-03-01 02:54
hguyy
Rank: 2
等 级:论坛游民
帖 子:56
专家分:20
注 册:2016-1-25
收藏
得分:0 
回复 6楼 sdta
大神,我运行了一下程序,太感谢您了。我做的是一个切分的程序,要的是在这5000多条记录中查出满足最低条件是3A5B1C的考生,也就是查出9科成绩中不能有D,只能有1科C,最多5科B,其他为A的考生,不是单单查出一个3A5B1C的考生。
筛选出来结果是这样的:BBAABBBAA
BBAABBBBA
BBBABBABB
BBBAABCAA
BBBABBBBA
ABBAABBAA
BBAABBABB
ACBABBBBB
AAAAAAAAA
上面这些数据是从下面这些数据中筛选出来的:
CDDAABAAA
CDDACDBBC
DDDBDDDDC
BBDABBBBB
CDDADDCDD
CDDACDABA
CDDBDDBDB
CDDADCCCB
BCDAAABBB
DDDBDDDBC
DBDBCDDDC
BDDACDBAB
DDCBDDDDC
BDDBDDCDD
CDDBDDCCB
BBAABBBAA
BDDABBAAB
DDDACCCDC
BBAABBBBA
BBBABBABB
DBDAABBAA
BBDBCBBBB
BBBAABCAA
CDDABBCBB
BBBABBBBA
BDCABBBBC
CDDACDBBA
DDDADDDAC
ABBAABBAA
BCAABBBCB
BBAABBABB
BDCACCCBB
BDBACCCCB
ACBABBBBB
BDDADDBDC
BDDACDBDB
BDDBDDDDC
AAAAAAAAA
BCBABBBBB
BCBADBCCC
ABCABBBBA
ABAAABAAA
ADBADDBBB
BBAACBBBA
BDCADCABA
ADDADDBBC
ADCADDBBB
ABAAAAAAA
BBBABBABA
ACBABBBBA
ADAABBBBA
BDDADDDCC
BDDACCBBB
DDDBDDDDD
ACAABBAAA
BCCABBBBB
BDDBDDDDD
BDBACABCB
CBDBBBBAA
CDDDDDDDD
CCCBCBBBB
BCBBBAABB
DDDBDDDDD
BDDCDDDCD
DDDCDDDDD
CDDCDBDBB
DDDDDDDDD
DCDCDDDCB
DDDBDBCCB
DBDBDBDCB
DDDDDDDDD
DDDDDDDDD
CDDCDDDDD
CCDBDBBBC
BCDACBABB
DDDDDDDDB
CBDBBABBB
CDDBDDDDD
BDDBDBBCB
DDDBDDDDD
ACAABBBBC
BDCADCCDC
CDD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DDD
BCBABBBBB
ABCABBBBA
ABAAABAAA
BBAACBBBA
ABAAAAAAA
BBBABBABA
ACBABBBBA
ACAABBAAA
BCBBBAABB
ACAABBBBC
2016-03-01 03:12
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10607
专家分:43186
注 册:2014-5-20
收藏
得分:5 
(OCCURS("A", 等级)==3) AND (OCCURS("B", 等级)==5) AND (OCCURS("C", 等级)==1)
2016-03-01 08:08
sdta
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:江苏省连云港市
等 级:版主
威 望:335
帖 子:9841
专家分:27213
注 册:2012-2-5
收藏
得分:0 
回复 8楼 hguyy
是你自己没说清楚

坚守VFP最后的阵地
2016-03-01 10:33
快速回复:一组5000个学生考试等级,总共10个科目,查找出考试等级满足3A5B1C的学 ...
数据加载中...
 
   



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

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