joylu


私信TA

用户名:joylu

访问量:1228

签 名:

等  级
排  名 4845
经  验 1570
参赛次数 0
文章发表 2
年  龄 0
在职情况 学生
学  校 河南大学
专  业

  自我简介:

解题思路:这是一道简单的模拟题,先判断两个字符串的长度是否相等,再判断是否完全相同,然后再判断忽略大小写的情况下,两个字符串是否相同

注意事项:

参考代码:

import java.io.*;

import java.math.BigDecimal;

import java.math.BigInteger;

import java.math.RoundingMode;

import java.util.*;


import javax.management.RuntimeErrorException;


public class Main {

    

static class InputReader 

{

public BufferedReader br;

public StringTokenizer tokenizer;

public InputReader(InputStream ins)

{

br=new BufferedReader(new InputStreamReader(ins));

tokenizer=null;

}

public String next()

{

while(tokenizer==null||! tokenizer.hasMoreTokens())

{

try {

tokenizer=new StringTokenizer(br.readLine());

} catch (Exception e) {

// TODO: handle exception

throw new RuntimeException(e);

}

}

return tokenizer.nextToken();

}

public int nextInt()

{

return Integer.parseInt(next());

}

public Long nextLong()

{

return Long.parseLong(next());

}

public double nextDouble()

{

return Double.parseDouble(next());

}

public String nextLine() throws IOException

{

return br.readLine();

}

}

    public static InputReader in;

    public static PrintWriter out;

    

    static int N=200000;

    static int mod=10007;

   

    static class Task

    {

   

    public void solve(InputReader in,PrintWriter out)

    {

    Scanner sc=new Scanner(System.in);

    String s1=sc.next();

    String s2=sc.next();

    int len1=s1.length();

    int len2=s2.length();

    if(len1!=len2)

    {

    out.println(1);

    }

    else 

    {

if(s1.equals(s2))

{

out.println(2);

}

else 

{

s1=s1.toLowerCase();

s2=s2.toLowerCase();

if(s1.equals(s2))

{

out.println(3);

}

else 

{

out.println(4);

}

}

}

   

   

    }

   

   

   

   

    }

   

        

    public static void main(String[] args) throws IOException{

   

    //InputStream ins=new FileInputStream("C:\\input.txt");

    InputStream ins=System.in;

    in=new InputReader(ins);

    out=new PrintWriter(System.out);

    new Task().solve(in, out);

    out.close();

   

   

   

       

    }

    

    

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区