{"size": 653, "ext": "js", "max_stars_repo_path": "js/create.js", "max_stars_repo_name": "Steady-Sy/four_algorihtms", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "js/create.js", "max_issues_repo_name": "Steady-Sy/four_algorihtms", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/create.js", "max_forks_repo_name": "Steady-Sy/four_algorihtms", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.1153846154, "max_line_length": 76, "alphanum_fraction": 0.4992343032}
/**
 * 生成题目，已经除去了负数情况
 * @param total 生成题目数量
 * @returns {Array}
 */
function create(total){
    var question = new Array(),
        answer = new Array(),
        param = /(\-\d+)|(\-\d+\/\d+)|(\d+\/\-\d+)/;//匹配-6,-3/7,11/-3这种负数的情况
    while(question.length !=Number(total)){
        var str = crateExpression();
//        document.write(str+"=");
        var Rpn =getRPN(str);
        var result = calculate(Rpn);
        if(param.test(result)){
            continue;
        }else{
            question.push(str);
            answer.push(result);
        }
    }
    var ret = new Array();
    ret[0] = question;
    ret[1] = answer;
    return ret;
}