首先,先看看java大数的基本操作
Ⅰ基本函数:
1.valueOf(parament); 将参数转换为制定的类型
比如 int a=3;
BigInteger b=BigInteger.valueOf(a);
则b=3;
String s=”12345”;
BigInteger c=BigInteger.valueOf(s);
则c=12345;
...
分类:
编程语言 时间:
2015-03-28 14:25:17
阅读次数:
234
static void Main(string[] args) { while (true) { double x,y; Console.Write("请输入坐车的距离:"); x = Convert.ToDouble(Console.ReadLine()); if (x>0&&x 3 && x ....
分类:
其他好文 时间:
2015-03-28 14:15:30
阅读次数:
117
最长回文子串,学习了一下manacher算法
#include
#include
char s[1000005];
int next[1000005];
int n;
//i,j两个指针所指的位置可以保证已经是该指针之前的串里,最优的了
int min(int a,int b){
if(a<b) return a;
return b;
}
int max(int a,int b...
分类:
其他好文 时间:
2015-03-28 13:04:30
阅读次数:
135
3KM以内8元超过3KM每公里1.2元超过5KM每公里1.5元根据坐车的距离计算出车费 static void Main(string[] args) { while (true) { double i,l, m1...
分类:
其他好文 时间:
2015-03-28 13:00:11
阅读次数:
183
static void Main(string[] args) { while (true) { Console.Write("请问有没有房子?:"); string a = Console...
分类:
其他好文 时间:
2015-03-28 12:58:46
阅读次数:
93
使用委托来做一些事情,大致思路是: 1、定义声明一个委托,规定输入参数和输出类型。2、写几个符合委托定义的方法。3、把方法列表赋值给委托4、执行委托 internal delegate int MyDelegate(); class Program { static void Main(string...
分类:
其他好文 时间:
2015-03-28 12:56:10
阅读次数:
111
原文地址 http://blog.stevex.net/string-formatting-in-csharp/When I started working with the .NET framework, one thing puzzled me. I couldn’t find sprintf(...
1、ArrarList 转换为 string[] : ArrayList list = new ArrayList(); list.Add("aaa"); list.Add("bbb"); string[] arrString = (string[])list.ToArray(typeof(...
分类:
其他好文 时间:
2015-03-28 12:49:23
阅读次数:
139
#include
#include
using namespace std;
void string_zip(string input,string &output)
{
if(input.empty())
return ;
char last='\0';
char current;
int count=0;
for(int i=0;i<input.size();++i)
{
...
分类:
编程语言 时间:
2015-03-28 11:36:29
阅读次数:
473
RandomAccessFile类/*
* RandomAccessFile类,随机读写文件
*
* 数据分段要有规律,每段大小相等,可以将每段数据设置为较大的值,足以存在每一个段的数据
*
*/
public class Test04 {
public static void main(String[] args) throws IOException {
/...
分类:
数据库 时间:
2015-03-28 11:36:05
阅读次数:
163