解题思路:
注意事项:
参考代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input =new Scanner(System.in);
String s = input.nextLine();
String sp = input.nextLine();
if(s.contains(sp))
System.out.print(sp + " " + "is substring of" + " " + s);
else if(sp.contains(s))
System.out.print(s + " " + "is substring of" + " " + sp);
else
System.out.print("No substring");
}
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题9.3 (Java代码)浏览:966 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:615 |
C语言程序设计教程(第三版)课后习题11.3 (C语言代码)浏览:1039 |
【出圈】 (C语言代码)浏览:796 |
剪刀石头布 (C语言代码)浏览:1755 |
C语言程序设计教程(第三版)课后习题5.5 (C语言代码)浏览:559 |
循环入门练习5 (C语言代码)浏览:839 |
整除问题 (C语言代码)浏览:526 |
杨辉三角 (C语言代码)浏览:679 |
1162答案错误,为什么浏览:644 |