因为牛客网上要自己写输入输出,这里给大家放个壳子。
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
String str1 = sc.next();
String str2 = sc.next();
System.out.println(testFun(str1, str2));
}
}
public static int testFun(String str1, String str2) {
int result = 0;
// 一系列逻辑
return result;
}
}
另,可以再参考下这个兄弟的文章: