前面提到过很多次大整数的问题,这个是真正的大整数。
我用了一个很蠢得方法,先写一个大整数和一个个位数相乘的方法,返回的结果是一个string,然后写一个string相加的方法,每次循环,用其中一个数的每一位去乘另一个数,然后加到结果上。。
多么愚蠢的思路,居然还一遍过了。。一个更好的方法是先用两个int数组把两个string存一下,每位占数组中的一个数,然后再用一个int数组保存结果,每次也是...
分类:
其他好文 时间:
2014-05-15 14:55:51
阅读次数:
322
作者:iamlaosong
一个简单的函数,从包含有数字信息的字符串中取出这个数据,利用VAL函数将字符串转换为数值,该函数或略数字字符串后面的字母和汉字信息,所以,只要把数字前面的字母和汉字信息去掉就行了。
'函数,从字符串“ABC123456.78DEF”中取出数据
Function mydata(mystring As String) As Double
Dim...
分类:
其他好文 时间:
2014-05-15 11:16:23
阅读次数:
448
创建表:
hive> CREATE TABLE pokes (foo INT, bar STRING);
Creates a table called pokes with two columns, the first being an integer and the other a string
创建一个新表,结构与其他一样
hive> create table n...
分类:
其他好文 时间:
2014-05-15 07:07:58
阅读次数:
303
//dal类: public class BaseDAL
{
string strConn = "";
public BaseDAL(string connString)
{
strConn = connString;
}
#region 通用增删改查
#region...
分类:
其他好文 时间:
2014-05-15 05:20:18
阅读次数:
283
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.
Notes: It is intended for this problem to be specifi...
分类:
其他好文 时间:
2014-05-15 05:00:50
阅读次数:
229
#include
#include
using namespace std;
class Teacher
{
public:
Teacher(string nam,int ag,char s,string ad,int num,string t)
{
name=nam;
age=ag;
sex=s;
...
分类:
其他好文 时间:
2014-05-15 04:32:56
阅读次数:
262
水题。
描述的还挺麻烦的,实际上就是纸老虎,用两个string,一个存上一轮的结果,一个用来更新出这一轮的结果,每次扫描上一轮,统计一个字符出现的次数,然后把这个次数和字符加入到这一轮的字符串中就可以了。
class Solution {
public:
string countAndSay(int n) {
if(n == 0) return "";
...
分类:
其他好文 时间:
2014-05-15 04:12:07
阅读次数:
289
【题目】
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.
【题意】
题意是找出字符串S中最长回文子串,S最长为1000,保证有唯一解
【思路】
原字符串用特殊字符#间隔,如下所示:
#a...
分类:
其他好文 时间:
2014-05-15 03:31:25
阅读次数:
299
题目一:
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
...
分类:
其他好文 时间:
2014-05-14 15:10:01
阅读次数:
293
原文:
1.5 Write a method to replace all spaces in a string with ‘%20’.
译文:
写一个函数,把字符串中所有的空格替换为%20 。...
分类:
其他好文 时间:
2014-05-14 14:09:29
阅读次数:
310