
java算法
L427630
这个作者很懒,什么都没留下…
展开
-
You're given a string of lower-case Latin letters. Your task is to find the length of its longest su
C - You're Given a String... 代码:import java.util.Arrays;import java.util.Scanner;public class Main {public static void main(String[] args){ int count=1,k=0,max=0,i=0; int[] sum=new int[100]; Sca...原创 2018-02-10 15:47:07 · 3259 阅读 · 0 评论 -
equation : Ax2 + Bx + C = 0.
B - Equation //训练6.2-B-Equation import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args){ double A,B,C,x1,x2; int coun...原创 2018-02-10 15:58:08 · 344 阅读 · 0 评论 -
Your task is to find for a given phone number any of its divisions into groups of two or three digit
D - Phone numbers 代码:Happy-训练6-Dimport java.util.Scanner;public class Main { public static void main(String[] args){ int n,i=0,m=1; Scanner scan=new Scanner(System.in); n=scan.nextInt(); ...原创 2018-02-10 23:29:26 · 369 阅读 · 0 评论 -
Determine whether the product of a and b is even or odd.
Problem StatementAtCoDeer the deer found two positive integers, a andb. Determine whether the product ofa andb is even or odd.Constraints1≤a,b≤10000a andb are integers.InputInput原创 2018-02-06 18:01:33 · 621 阅读 · 0 评论 -
You went shopping to buy cakes and donuts with X yen
Problem StatementYou went shopping to buy cakes and donuts with X yen (the currency of Japan).First, you bought one cake for A yen at a cake shop. Then, you bought as many donuts as possible原创 2018-02-06 18:33:57 · 394 阅读 · 0 评论 -
Determine whether the concatenation of a and b in this order is a square number.
Problem StatementAtCoDeer the deer has found two positive integers, a andb. Determine whether the concatenation ofa andb in this order is a square number.Constraints1≤a,b≤1原创 2018-02-06 19:50:35 · 520 阅读 · 0 评论 -
In how many ways can we select some of these coins so that they are X yen in total?
Problem StatementYou have A500-yen coins,B100-yen coins andC50-yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in tota原创 2018-02-07 13:40:43 · 341 阅读 · 0 评论 -
E - BerOS file system
The new operating system BerOS has a nice feature. It is possible to use any number of characters '/' as a delimiter in path instead of one traditional '/'. For example, strings //usr///local//nginx...原创 2018-02-14 16:43:32 · 281 阅读 · 0 评论