import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k=n/10; int i=k/5*2; int j=(k-(k/5)*5)/3; System.out.println(k+i+j); } }…
思路: 先看能不能买5瓶,因为送的最多,然后看能不能买3瓶,最后一瓶一瓶地买 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int count = 0; if(N/50 > 0) { count += (N/50)*7; N = N % 50; } if…
CDI(Contexts and Dependency Injection 上下文依赖注入),是JAVA官方提供的依赖注入实现,可用于Dynamic Web Module中,先给3篇老外的文章,写得很不错 1.Java EE CDI Dependency Injection (@Inject) tutorial2.Java EE CDI Producer methods tutorial3.Java EE CDI bean scopes 此外,还有jboss官方的参考文档:http://docs…