题目见附件图片
一些很基础的题目
Seven:
[Java] 纯文本查看 复制代码 import java.util.Scanner;
public class Seven {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
char ch = s.charAt(i);
if (Character.isLetter(ch)) {
sb.append(ch);
}
}
System.out.println(sb.toString());
//第二种直接正则表达替换
// System.out.println(s.replaceAll("[^a-zA-Z]", ""));
}
}
Eight:
[Java] 纯文本查看 复制代码 public class Eigth {
public static void main(String[] args) {
String a = "Hi";
String b = "mom";
System.out.println(a.concat(b));
System.out.println("q");
System.out.println("y");
}
}
Nine:
[Java] 纯文本查看 复制代码 public class Nine {
public static void main(String[] args) {
String word = "Software";
System.out.println(new StringBuffer(word).reverse());
String s = "ware";
if (word.contains(s)) {
System.out.println(s + "是" + word + "的子串");
} else {
System.out.println(s + "不是" + word + "的子串");
}
}
}
Eleven:
[Java] 纯文本查看 复制代码 import java.text.SimpleDateFormat;
import java.util.Date;
public class Eleven {
public static void main(String[] args) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
System.out.println(sdf.format(new Date()));
}
}
Twelve:
[Java] 纯文本查看 复制代码 public class Twelve {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
char[] chars = s.toCharArray();
int dig = 0;
int blank = 0;
int ch = 0;
int other = 0;
for (char aChar : chars) {
if (Character.isDigit(aChar)) {
dig++;
} else if (Character.isLetter(aChar)) {
ch++;
} else if (aChar == ' ') {
blank++;
} else {
other++;
}
}
System.out.println("英文字母有" + ch + "个,数字有" + dig + "个," +
"空格有" + blank + "个,其他字符有" + other + "个");
}
}
在新标签打开所有链接复制所有链接URL复制所有链接URL(反向)复制所有链接标题 + URL复制所有链接标题 + URL (MD)复制所有链接标题 + URL (BBS)复制所有链接标题 + URL (筛选)复制所有链接标题 + URL (设置复制格式)在新标签页打开所有图片链接在一个标签页显示所有图片链接
复选框 - 选中
复选框 - 取消
复选框 - 反选
单选框 - 选中
单选框 - 取消
特殊单选框 - 选中 |