Problem Description给定两个整数A和B,其表示形式是:从个位开始,每三位数用逗号","隔开。现在请计算A+B的结果,并以正常形式输出。Input输入包含多组数据数据,每组数据占一行,由两个整数A和B组成(-10^9 < A,B < 10^9)(没有超出整型的表示范围)。Output请计算A+B的结果,并以正常形式输出,每组数据占一行。Sample Input-234,567,890 123,456,789 1,234 2,345,678Sample Output-111111101 2346912瞧瞧我臃肿复杂的代码,竟然也过了,可是足足花了我 Read More
posted @ 2012-02-24 23:42 吞枣 Views(483) Comments(1) Diggs(0)
做的有点混乱,效率也不是太高,如分割数字时,就不如挨个扫描来的快,怎么就没想到呢?笨呢!还有可以先求出前25个素数,这样代码效率会高些长度也会小些。#include <iostream>#include <fstream>#include <cstring>#include <string>#include <algorithm>// 浙大2006 杭电1230using namespace std;#define MAX 25int prime[MAX];bool isPrime(int n){ for (int i = 2; i Read More
posted @ 2012-02-24 21:34 吞枣 Views(203) Comments(0) Diggs(0)