1823196911

文章详细介绍了搜狗输入法的自定义短语配置,包括单行和多行格式,以及如何使用时间函数创建动态内容。还提供了多个Java代码示例,如成绩分级、数组重复检查、超速计算等。此外,强调了自定义短语可用于快捷输入各种信息,并给出了配置文件的使用指南。
摘要由CSDN通过智能技术生成

;  搜狗输入法--自定义短语配置文件

;  自定义短语说明:
;  1、自定义短语支持多行、空格、指定位置。
;  2、每条自定义短语最多支持30000个汉字,总共支持100000条自定义短语。
;  3、自定义短语的格式如下:

;  单行的格式:
;  字符串+英文逗号+数字(指定排序位置)=短语

;  多行的格式:
;  字符串+英文逗号+数字(指定排序位置)=
;  多行短语

;  具体格式可以参考下面的实例。
;  4、最多支持100000行自定义短语。
;  5、自定义短语的用途有:快捷输入手机号、邮箱、诗词、小短文等,大家可以自由发挥。
;  6、时间函数功能。具体定义格式如下:;  字符串+英文逗号+数字(指定排序位置)=#表达式
;  注意:表达式以英文#开头,后面的表达式中的每一个函数的前面都包含有英文$。
;  函数表如下:
;  函数        含义        举例
;  $year        年(4位)     2006、2008
;  $year_yy    年(2位)     06、08
;  $month         月          12、8、3
;  $month_mm      月          12、08、03        //此函数在输入法3.1版之后(含)有效
;  $day         日          3、13、22
;  $day_dd    日           03、13、22    //此函数在输入法3.1版之后(含)有效
;  $weekday     星期        0、1、2、5、6
;  $fullhour    时(24小时制)      2、8、13、23
;  $fullhour_hh    时(24小时制)      02、08、13、23        //此函数在输入法3.1版之后(含)有效
;  $halfhour    时(12小时制)    2、8、10、11
;  $halfhour_hh    时(12小时制)    02、08、10、11        //此函数在输入法3.1版之后(含)有效
;  $ampm        AM、PM(英)    AM、PM(大写)
;  $minute      分          02、08、15、28
;  $second      秒          02、08、15、28
;  $year_cn     年(中文4位)    二〇〇六
;  $year_yy_cn    年(中文2位)    〇六
;  $month_cn    月(中文)    十二、八、三
;  $day_cn      日(中文)    三、十三、二十二
;  $weekday_cn     星期(中文)    日、一、二、五、六
;  $fullhour_cn    时(中文24时制)    二、八、十三、二十三
;  $halfhour_cn    时(中文12时制)    二、八、一、十一
;  $ampm_cn     上午下午(中文)    上午、下午
;  $minute_cn    分(中文)    零二、零八、十五、二十八
;  $second_cn    秒(中文)    零二、零八、十五、二十八
;  具体你可以参考这个文件最下面的例子,实际体验一下就明白了。
;  你可以用自定义短语来做一个带动态时间的多行回信落款。
;  ss,1=#$year年$month月$day_dd日 $fullhour:$minute:$second

chengji,1=
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int score = scanner.nextInt();
        scanner.close();

        String grade;

        if (score < 60) {
            grade = "E";
        } else if (score < 70) {
            grade = "D";
        } else if (score < 80) {
            grade = "C";
        } else if (score < 90) {
            grade = "B";
        } else {
            grade = "A";
        }

        System.out.println(grade);
    }
}
chongfushuju,1=
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String nums = sc.nextLine();
        sc.close();
        String numsAfter[] = nums.split(" ");
        boolean result = false;
        for(int i = 0 ; i < numsAfter.length; i ++){
            for(int j = 0 ; j < numsAfter.length ; j++){
                // 这里一定要注意 一定不能自己和自己比较,所以加条件 i != j
                if(numsAfter[i].equals(numsAfter[j])&& i != j ){
                    result = true;
                }
            }
        }
        if(result == true){
            System.out.println("yes");
        }else System.out.println("no");
    }
}
gaosugonglu,1=
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int speed = in.nextInt();
        int limit = in.nextInt();
        double exceed = (double)(speed - limit) / limit * 100;
        if (exceed < 10) {
            System.out.println("OK");
        } else if (exceed < 50) {
            System.out.printf("Exceed %.0f%%. Ticket 200", exceed);
        } else {
            System.out.printf("Exceed %.0f%%. License Revoked", exceed);
        }
        in.close();
    }
}
jige,1=
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int score;
        int unPass = 0;
        int Pass = 0;
        for(int i = 0 ; i < n;i++){
            score = sc.nextInt();
            if(score<0||score>100){
                try{
                    throw new ScoreExcrption(score);
                }catch(ScoreExcrption e){
                    System.out.println(e.toString());
                    i--;
                }

            }else if(score <60) unPass++;
            else Pass++;
        }
        sc.close();
        System.out.println(Pass);
        System.out.println(unPass);
    }
}
class ScoreExcrption extends Exception{
    int score;
    public ScoreExcrption(){

    }
    public ScoreExcrption(int score){
        this.score = score;
    }
    public String toString(){
        return this.score+"invalid!";
    }
}
jishuoushu,1=
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int oddCount = 0, evenCount = 0;

        for (int i = 1; i <= n; i++) {
            if (i % 2 == 1 && i % 3 == 0) {
                oddCount++;
            } else if (i % 2 == 0 && i % 3 == 0) {
                evenCount++;
            }
        }

        System.out.printf("%d,%d\n", oddCount, evenCount);
    }
}
juxing,1=
import java.util.Scanner;
class Rectangle{
    private double width = 1.0;
    private double height = 1.0;
    public Rectangle(double width, double height) {
        this.width = width;
        this.height = height;
    }
    public double getArea() {
        return this.height * this.width;
    }
    public double getPerimeter() {
        return 2 * (this.height + this.width);
    }
}
kache,1=
interface ComputeWeight {
    public abstract double computeWeight();
}

class Television implements ComputeWeight {

    public double computeWeight() {

        return 16.6;
    }

}
class AirConditioner implements ComputeWeight {

    public double computeWeight() {

        return 40.0;
    }

}
class WashMachine implements ComputeWeight {

    public double computeWeight() {

        return 60.0;
    }

}

class Truck{
    private ComputeWeight[] goods;

    public Truck(ComputeWeight[] goods){
        this.goods =goods;
    }

    public double getTotalWeight(){
        double result = 0;
        for(int i = 0 ; i < goods.length;i++){
            result += goods[i].computeWeight();
        }
        return result;
    }
}
kaitou,1=
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        sc.close();
        String words[] = input.split(" ");
        int result = 0;
        for(int i = 1; i < words.length;i++){
            if(words[0].equals(words[i].substring(0, 1))){
                result++;
            }
        }
        System.out.print(result);
    }
}
nianyue,1=
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true){
            String idNums = sc.next();
            if(idNums.length()!=18){
                System.out.println("Invalid data,input again!");
            }else{
                System.out.println(idNums.substring(6, 10)+","+idNums.substring(10,12));
                break;
            }
        }
    }
}
nianyueri,1=
import java.util.Scanner;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String idNums[] = new String[n];
        for (int i = 0; i < n; i++) {
            idNums[i] = sc.next();
        }
        while (true) {
            String xuanze = sc.next();
            if (xuanze.equals("sort1"))
                sort1(idNums);
            else if (xuanze.equals("sort2"))
                sort2(idNums);
            else {
                System.out.println("exit");
                break;
            }
        }

        sc.close();
    }

    // 年-月-日 升序
    public static void sort1(String a[]){
        int len = a.length;
        String b[] = new String[len];
        for(int i = 0 ; i < len ; i++){
            b[i] = a[i].substring(6, 14);
        }
        Arrays.sort(b);
        for(int i = 0 ; i < len ; i++){
            System.out.println(b[i].substring(0,4)+"-"+b[i].substring(4,6)+"-"+b[i].substring(6, 8));
        }
    }

    // 全部身份证号 年-月-日 升序
    public static void sort2(String a[]){
        int len = a.length;
        String b[] = new String[len];
        for(int i = 0 ; i < len ; i++){
            b[i] = a[i].substring(6, 14);
        }
        Arrays.sort(b);
        Arrays.sort(a);
        for(int i = 0 ; i < len ;i ++){
            for( int j = 0 ; j < len; j++){
                if(a[j].contains(b[i])){
                    System.out.println(a[j]);
                }
            }
        }
    }
}
paisheng,1=
public People(){

}

public People(String id, String name){
    this.id = id;
    this.name = name;
}

public void setId(String id){
    this.id = id;

public void setName(String name){
    this.name = name;
}

public String getId(){
    return id;
}

public String getName(){
    return name;
}

public void say() {
    System.out.println("I'm a person! My name is " + this.name + ".");
}
pingjunshu,1=
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = 10;
        int sum = 0;
        for (int i = 0; i < n; i++) {
            sum += in.nextInt();
        }
        double avg = (double) sum / n;
        System.out.printf("%.2f", avg);
        in.close(); //关闭输入流
    }
}
psvm,1=
import java.util.Scanner;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String name = sc.nextLine();
        System.out.println("Hello "+name);
        sc.close();
    }
}
sange,1=
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        char c = scanner.next().charAt(0);
        int i = scanner.nextInt();
        double d = scanner.nextDouble();
        System.out.println(c);
        System.out.println(i);
        System.out.printf("%.6f", d);
    }
}
worker,1=
class Worker {
    String name;
    double hourPay;

    public Worker() {

    }

    public Worker(String name, double hourPay) {
        this.name = name;
        this.hourPay = hourPay;
    }

    public double getHourPay() {
        return hourPay;
    }

    public void setHourPay(int hourPay) {
        this.hourPay = hourPay;
    }

    public void pay(double workHour) {
        System.out.println("Not Implemented");
    }

}

class HourlyWorker extends Worker {
    public HourlyWorker(String name, double hourPay) {
        this.name = name;
        this.hourPay = hourPay;
    }

    public void pay(double workHour) {
        if (workHour <= 40) {
            System.out.println((workHour * hourPay));
        } else
            System.out.println((((workHour - 40) * 2) + 40) * hourPay);
    }

    public void setRate(double hourPay) {
        this.hourPay = hourPay;
    }
}

class SalariedWorker extends Worker {

    public SalariedWorker(String name, double hourPay) {
        this.name = name;
        this.hourPay = hourPay;
    }

    public void pay() {
        System.out.println((40 * hourPay));
    }

    public void pay(double workHour) {
        System.out.println((40 * hourPay));
    }
}
yuan,1=
class Circle{
    double r;
    public Circle(double r){
        this.r = r;
    }
    public double area() throws CircleException{
        if(r<=0){
            throw new CircleException(this.r);
        }
        return (this.r * this.r * 3.14);
    }
}

class CircleException extends Exception{
    double r;
    public CircleException(){

    }
    public CircleException(double r){
        this.r = r;
    }
    public void print(){
        System.out.println("圆半径为"+this.r+"不合理");
    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值