上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 182 下一页
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 32int f[maxn];int g[maxn];int main(){// freopen("t.txt", "r", stdin); while (1) { int n = 0; int a; while (scanf("%d", &a), 阅读全文
posted @ 2013-02-26 13:48 undefined2024 阅读(143) 评论(0) 推荐(0)
摘要: 进制转换,java做StringBuffer 的方法中setCharAt(int,char)可以改变其某位的字符View Code import java.io.*;import java.util.*;import java.math.*;public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); while (cin.hasNext()) { String st = cin.ne... 阅读全文
posted @ 2013-01-22 12:29 undefined2024 阅读(171) 评论(0) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;void work(int n){ int a = n * n * n; for (int i = 2; ;i++) { int b = i * i * i; if (b * 3 > a) break; for (int j = i; ; j++) { int c = j... 阅读全文
posted @ 2013-01-22 09:09 undefined2024 阅读(213) 评论(0) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 100005int step, mod;bool vis[maxn];int generate(int step, int mod){ memset(vis, 0, sizeof(vis)); int x = 0; int ret = 0; while (!vis[x]) { vis[x] = true; ... 阅读全文
posted @ 2013-01-18 16:52 undefined2024 阅读(158) 评论(0) 推荐(0)
摘要: 素数筛View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <cmath>using namespace std;#define maxn 1005#define maxm 1005bool is[maxn];int prm[maxm];int n, m;int sum[maxn];int getprm(int n){ int i, j, k = 0; int s, e = (int) (sqrt(0.0 + 阅读全文
posted @ 2013-01-18 16:39 undefined2024 阅读(272) 评论(0) 推荐(0)
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 182 下一页