⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transstr.java

📁 数学网
💻 JAVA
字号:
package math.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author dothwinds
 * @vip level type change
 */
public class TransStr {
	public static String trans(String ss) {
		String temp = "";
		Pattern p = Pattern.compile("\r\n");
		Matcher m = p.matcher(ss);
		temp = m.replaceAll("<br>");
		p = Pattern.compile(" ");
		m = p.matcher(temp);
		temp = m.replaceAll("&nbsp;");
		return temp;
	}

	private static String htea_type;

	public static String getHtea_type(int level) {
		switch (level) {
		case 0:
			htea_type = "找家教";
			break;
		case 1:
			htea_type = "做家教";
			break;

		default:
			htea_type = "找家教";
			System.out.println("man_sex is not a number or a space");
		}
		return htea_type;
	}

	private static String vip = "";

	private static String type = "";

	private static String difficulty = "";

	private static String answer = "";

	private static String award = "";

	public static String getAward(int award_no) {

		switch (award_no) {
		case 1:
			award = "1分";
			break;
		case 2:
			award = "2分";
			break;
		case 3:
			award = "3分";
			break;
		case 4:
			award = "4分";
			break;
		case 5:
			award = "5分";
			break;
		case 6:
			award = "6分";
			break;
		case 7:
			award = "7分";
			break;
		case 8:
			award = "8分";
			break;
		case 9:
			award = "9分";
			break;
		default:
			System.out.println("man_sex is not a number or a space");
		}
		return award;

	}

	public static String getDifficulty(int difficulty_no) {

		switch (difficulty_no) {
		case 0:
			difficulty = "一年级";
			break;
		case 1:
			difficulty = "二年级";
			break;
		case 2:
			difficulty = "三年级";
			break;
		case 3:
			difficulty = "四年级";
			break;
		case 4:
			difficulty = "五年级";
			break;
		case 5:
			difficulty = "六年级";
			break;
		case 6:
			difficulty = "七年级";
			break;
		case 7:
			difficulty = "八年级";
			break;
		case 8:
			difficulty = "九年级";
			break;
		default:
			System.out.println("man_sex is not a number or a space");
		}
		return difficulty;
	}

	public static String getAnswer(int answer_no) {
		switch (answer_no) {
		case 0:
			answer = "A";
			break;
		case 1:
			answer = "B";
			break;
		case 2:
			answer = "C";
			break;
		case 3:
			answer = "D";
			break;
		default:
			System.out.println("man_sex is not a number or a space");
		}
		return answer;
	}

	public static String getVip(int vip_no) {
		switch (vip_no) {
		case -1:
			vip = "未注册";
			break;
		case 0:
			vip = "注册用户";
			break;
		case 9:
			vip = "普通会员";
		case 99:
			vip = "高级会员";
			break;
		case 555:
			vip = "管理员";
		case 999:
			vip = "超级管理员";
		default:
			System.out.println("man_sex is not a number or a space");
		}
		return vip;
	}

	public static String getType(int type_no) {
		switch (type_no) {
		case 0:
			type = "几何";
			break;

		case 1:
			type = "代数";
			break;

		case 2:
			type = "应用题";
			break;
		default:
			System.out.println("man_sex is not a number or a space");
		}
		return type;
	}

	private static String bbs_state;

	public static String getBbs_state(int state) {
		switch (state) {
		case 2:
			bbs_state = "已解决";
			break;
		case 1:
			bbs_state = "已解决";
			break;
		case 0:
			bbs_state = "未解决";
			break;
		default:
			System.out.println("bbs_state is not a number or a space");
		}
		return bbs_state;
	}

	private static String user_sex;

	public static String getUser_sex(int sex_num) {
		switch (sex_num) {
		case 0:
			user_sex = "男";
			break;
		case 1:
			user_sex = "女";
			break;

		default:
			System.out.println("man_sex is not a number or a space");
		}
		return user_sex;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -