java ´óÊýÀà
import java.io.*;
class BigInt
{
int a[];
int len;
BigInt(String str)
{
{
len=str.length();
a=new int[len];
for(int i=0;i<len;i++)
{
this.a[i]=str.charAt(i)-48;
}
}
}
public BigInt bigplus(BigInt b)
{
BigInt sum;
int l;
int m=len-1;
int n=b.len-1;
int max;
if(len>=b.len)
{
l=b.len;
max=len-1;
sum=this;
}
else
{
l=len;
sum=b;
max=b.len-1;
}
for(int i=0;i<l;i++)
{
sum.a[max]=a[m]+b.a[n];
if(max!=0&&sum.a[max]>=10)
{
sum.a[max]=sum.a[max]-10;
sum.a[max-1]++;
}
m--;
n--;
max--;
}
return sum;
}
public void output()
{
for(int i=0;i<len;i++)
{
System.out.print(a[i]);
}
}
}
class TestBig
{
public static void main(String[] args) throws IOException
{
String str1;
String str2;
System.out.println("ÇëÊäÈë´óÊý1:");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
str1=br.readLine();
System.out.println("ÇëÊäÈë´óÊý2:");
BufferedReader br1=new BufferedReader(new InputStreamReader(System.in));
str2=br1.readLine();
BigInt a1=new BigInt(str1);
BigInt a2=new BigInt(str2);
BigInt a3=a1.bigplus(a2);
a3.output();
}
}
Ïà¹ØÎĵµ£º
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import com.paic.is.dispatch.TMPEntry;
public class DateTimeUtil
{
public final static String LOCAL_SHORT_DATE_FORMAT = "yyyy-MM-dd";
public final static String LOCAL_LONG_DATE_FORMAT = "yyyy-MM-dd H ......
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;
public class DocumentUtil
{
public static Document loadXMLByAbsolutePath(String absoluteFilePath, String logFileName)
{
SAXReader saxReader = new SAXReader();
Document document = null;
try ......
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import com.paic.is.dispatch.TMPEntry;
public class FileUtil
{
public static File getFileByRelativePath(String ......
1. Java Ô´ÎļþÖÐ×î¶àÖ»ÄÜÓÐÒ»¸öpublicÀà,¶øÇÒÕâ¸öÀàµÄÀàÃûÒªºÍÎļþÃûÒ»ÖÂ.ÆäËûÀàµÄ¸öÊý²»ÏÞ¡£
2. ÃæÏò¶ÔÏó³ÌÐòÉè¼ÆµÄÌØÕ÷£¨·â×°ÐÔ£©£¨¼Ì³Ð£©£¨¶à̬ÐÔ£©
3. ½Ó¿ÚÊÇÓÉ£¨³éÏó·½·¨£©ºÍ£¨³£Á¿£©×é³ÉµÄÌØÊâÀà
4. ÓÃstaticÐÞÊεķ½·¨Ê ......