×î´ó³Ë»ýµÄN 1ÏֻÓó˷¨²»ÄÜÓó˷¨ (Java)ʵÏÖ
package algorithm.misc;
import util.*;
public class MaxProductOfN1 {
private static int exceptIndex = -1;
public static long regMethod(int data[])
{
long ret = Long.MIN_VALUE;
long tmp = 1;
for(int i = 0; i < data.length; i++)
{
tmp = 1;
for(int j = 0; j < data.length; j++)
{
if(j != i)
{
tmp *= data[j];
}
}
if(tmp > ret)
{
ret = tmp;
exceptIndex = i;
}
}
return ret;
}
public static long dp(int data[])
{
long ascent[] = new long[data.length + 1];
ascent[0] = 1;
for(int i = 0; i < data.length; i++)
&nbs
Ïà¹ØÎĵµ£º
ÕâÊÇÒ»¸ö¼òµ¥µÄ·ÂÕæ³ÌÐò:
ÔÚÕâ¸ö·ÂÕæ³ÌÐòÖÐ,»¨Ô°Î¯Ô±»á¶¼Ï£ÍûÁ˽âÿÌìͨ¹ý´óÃŽøÈ빫԰µÄ×ÜÈËÊý.ÿ¸ö´óÃŶ¼ÓÐÒ»¸öÊ®×Ö
תÃÅ»òijÖÖÆäËûÐÎʽµÄ¼ÆÊýÆ÷,²¢ÇÒÈκÎÒ»¸öÊ®×ÖתÃŵļÆÊýÆ÷µÝÔöʱ,¾Í±íʾ¹«Ô°ÖеÄ×ÜÈËÊýµÄ¹²Ïí
¼ÆÊýÖµÒ²»áµÝÔö
package OrnamentalGarden;
import java.util.Random;
/**
* ÕâÀïʹÓõ¥¸öµ ......
2. Calendar ¶ÔÏóµÄÈÝ´íÐÔ£¬Lenient ÉèÖà ÎÒÃÇÖªµÀÌض¨µÄÔ·ÝÓв»Í¬µÄÈÕÆÚ£¬µ±Ò»¸öÓû§¸ø³ö´íÎóµÄÈÕÆÚʱ£¬Calendar ÈçºÎ´¦ÀíµÄÄØ£¿ import java.io.*;
import java.util.*; public class WhatIsCalendar
{
public static void main(String[] args) throws Exception{
......
ÎÒÃǾ³£ÏÂÔØ¿ªÔ´ÏîÄ¿µÄÔ´ÂëÔÚ±¾µØ±àÒë,ÊDz»ÊǾ³£±»Ò»¾ä"assert expression"¸ø¸ãµÃ±àÒë²»¹ýÈ¥£¬¾³£ÊÇÔÚÀÏ°æ±¾µÄjdk±àÒëÆ÷ÏÂû°ì·¨£¬ÏÂÃæ¾ÍÏò´ó¼ÒÍƼöһƪÉîÈë·ÖÎöjava assertionµÄÎÄÕ¡£
Ò»¡¢assertionµÄÓï·¨ºÍÓïÒå
J2SE 1.4ÔÚÓïÑÔÉÏÌṩÁËÒ»¸öÐÂÌØÐÔ£¬¾ÍÊÇassertion(¶ÏÑÔ)¹¦ÄÜ£¬ËüÊǸð汾ÔÚJavaÓïÑÔ·½Ãæ×î´ ......
µÚ¶þÖÖ¼òµ¥µÄ·½·¨¾ÍÊÇ,ÔÚhttp://proguard.sourceforge.net/ÏÂÔØZIP°ü.×îеÄÊÇ4.5BETA
½âѹËõºó,Ë«»÷proguardgui.jar
ÔËÐÐÈí¼þ
×îɵ¹ÏµÄÉèÖ÷½·¨:ÉèÖúÃINPUT/OUTPUT,µãPROCESS.½á¹û¾Í³öÀ´ÁË.
Éú³ÉÁË.a.class.b.class ÓÃJAD·´±àÒë,JADÌáʾ:²»ÄÜÍêÕûµÄ·´±àÒë....,´ò¿ª±àÒëºóµÄ´úÂë±äÁ¿ºÍº¯ÊýÃûÈ«²¿±»Ì ......