public class ABCTest {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String str = in.nextLine();
in.close();
System.out.println(sum(str));
}
public static int sum(String str) {
int sum = 0;
for(int i=0;i
public class ABCTest {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String str = in.nextLine();
int b = in.nextInt();
in.close();
System.out.println(div(str,b));
}
public static int div(String strArr,int b) {
int count = 0;
String[] str = strArr.split(" ");
for(int i=0; i
public class ABCTest {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
System.out.println(stairs(n));
}
public static int stairs(int num) {
if(num==0)
return 0;
if(num==1)
return 1;
if(num==2)
return 2;
return stairs(num-1)+stairs(num-2);
}
}
public class ABCTest {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String str = in.nextLine();
in.close();
System.out.println(reverse(str));
}
public static String reverse(String str) {
if(str==null)
return null;
StringBuffer buffer = new StringBuffer(str);
return buffer.reverse().toString();
}
}
public class ABCTest {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int sum = 0;
for(int i=0;i
public class ABCTest {
public static void main(String[] args) {
System.out.println("请输入内容,输入0结束:");
Scanner sc = new Scanner(System.in);
String str = "";
List str_list = new ArrayList();
str = sc.nextLine();
while(str!=null && !str.equals("0")) {
str_list.add(str);
str = sc.nextLine();
}
Acronym(str_list);
}
public static void Acronym(List list) {
for(int i=0;i
public class ABCTest {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] arr = new int[10];
for(int i=0;i<10;i++)
arr[i] = sc.nextInt();
int max=arr[0], min=arr[0];
int t1=0,t2=0;
for(int i=1;i<10;i++) {
if(min>arr[i]) {
min = arr[i];
t1=i;
}
if(max
public static int eatpeaches(int days) {
int sum = 1;
for(int i=days;i>1;i--)
sum = (sum+1)*2;
return sum;
}
public class ABCTest {
public static void main(String[] args) {
String str1,str2;
Scanner sc = new Scanner(System.in);
str1 = sc.nextLine();
str2 = sc.nextLine();
System.out.println(appearedOnce(str1,str2));
}
public static String appearedOnce(String str1,String str2) {
String str = "";
if(str1==null)
return null;
if(str2==null)
return str1;
for(int i=0;i
public class ABCTest {
public static void main(String[] args) {
String str;
Scanner sc = new Scanner(System.in);
str = sc.nextLine();
str = str.replaceAll("a", "c");
str = str.replaceAll("A", "c");
System.out.println(str);
}
}
public class ABCTest {
public static void main(String[] args) {
System.out.println(getdays(2019,4,5));
}
public static int getdays(int year, int month, int day) {
int days = 0;
switch(month-1) {
case 12: days+=31;
case 11: days+=30;
case 10: days+=31;
case 9: days+=30;
case 8: days+=31;
case 7: days+=31;
case 6: days+=30;
case 5: days+=31;
case 4: days+=30;
case 3: days+=31;
case 2: days+=28;
case 1: days+=31;
}
days += day;
if(month>2 && ((year%4==0 && year%100!=0) || (year%400==0)) )
days++;
return days;
}
}
public static boolean isprimenum(int num) {
if(num<=3)
return num>1;
for(int i=2;i
public class ABCTest {
public static boolean isleapyear(int year) {
return (year%4==0 && year%100!=0)||(year%400==0);
}
}
public class ABCTest {
public static boolean isSqrtNum(int num) {
int i=1;
while(num>0) {
num -= i;
i += 2;
}
return num==0;
}
}
public class ABCTest {
public static double summiles(int count) {
double all = 100.0d;
for(;count>0;count--)
all /= 2.0;
return all;
}
}
public class ABCTest {
public static int unique(int[] numarr) {
for(int i=0;i
public static String kaisacode(String str){
String newstr = "";
for(int i = 0 ; i < str.length() ; i ++){
char ch = str.charAt(i);
if( ch >= 'a' && ch <= 'z')
newstr += (char)(( ch - 'a' + 5 ) % 26 + 'a');
// 加密 +
else if( ch >= 'A' && ch <= 'Z')
newstr += (char)(( ch - 'A' + 5 ) % 26 + 'A');
else
newstr += ch;
}
return newstr;
}
public static int heyinliao(int num){
int money = num;
int ping = 0;
int kongping = 0;
while(money > 0){
money --;
ping ++;
kongping ++;
if(kongping == 2){
ping ++;
kongping = 0;
kongping ++;
}
}
if(kongping == 2)
ping++;
return ping;
}