- 博客(76)
- 收藏
- 关注
原创 hdu 1016 Prime Ring Problem
#include #include #include using namespace std; bool prim[40]; int num[25]; bool used[25]; /*建立素数表*/ void is_prim() { memset(prim,0,sizeof(prim)); prim[0]=prim[1]=1; int s
2014-07-08 22:01:09
591
原创 hdu 1241 Oil Deposits
#include #include #include using namespace std; int direct[8][2]={-1,0,1,0,0,1,0,-1,1,1,-1,1,-1,-1,1,-1};//八个方向 char map[105][105]; int m,n; int Dx,Dy; int ans; void DFS(int x,int y) { int p,q,k
2014-07-08 20:40:45
463
原创 hdu 1312
#include #include using namespace std; int direct[4][2]={-1,0,1,0,0,1,0,-1};//定义移动的四个方向,左右上下 char map[20][20]; bool mark[20][20]; int W,H; int Dx,Dy; int ans; void DFS(int x,int y) { int p,q,k;
2014-07-08 15:44:13
483
原创 线性链表合并
还是出错。。。 #include #include #define OK 1 #define ERROR 0 #define TRUE 1 #define OVERFLOW -2 typedef int Status; typedef struct LNode{ int data; struct LNode
2013-11-27 17:51:25
777
原创 线性表合并
#include #include #define OK 1 #define ERROR 0 #define TRUE 1 #define OVERFLOW -2 typedef int Status; #define LIST_INIT_SIZE 100 #define LISTINCREMENT 10 typed
2013-11-20 17:56:55
857
原创 进制转换
%a(%A) 浮点数、十六进制数字和p-(P-)记数法(C99) %c 字符 %d 有符号十进制整数 %f 浮点数(包括float和doulbe),单精度 %lf 浮点数(包括float和doulbe),双精度 %e(%E) 浮点数指数
2013-11-20 17:51:30
743
原创 二叉树字符型遍历
输入时不能带有空格,不知道为什么。。 #include #include #include #define OK 1 #define OVERFLOW -2 typedef int Status; typedef struct BiTNode { char data;// 结点的值 struct BiTNode *lchild,*rchild;// 左右孩子指针 }
2013-11-12 19:38:13
733
转载 如何建立二叉树
http://zhidao.baidu.com/link?url=TTleAJ9OTfXoCnPDS9GdJaIlY2kXsZWhJm02QHq8knrm6NwRhzIdR_GBWSHA0QGAqsBFlKtgb9PoAC2CGb4b8K
2013-11-11 17:43:46
736
转载 完整java开发中JDBC连接数据库代码和步骤
http://www.cnblogs.com/hongten/archive/2011/03/29/1998311.html
2013-10-27 19:11:33
466
原创 走迷宫伪代码
typedef struct { int m,n; char arr[RANGE][RANGE]; }MazeType; Status Pass(MazeType maze,PostType curpos) { if(maze.arr[curpos.r][curpos.c]==' ') return TRUE; else return FALSE; }
2013-10-16 16:49:37
1751
原创 链表排序
#include #include #define OK 1 #define ERROR -1 #define OVERFLOW -2 typedef int Status; typedef struct LNode { int data; struct LNode *next; }LNode,*LinkLi
2013-10-09 17:59:32
526
原创 建立线性表
#include #include #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define OVERFLOW -2 typedef int Status; #define LIST_INIT_SIZE 100 typedef int ElemType; typedef struc
2013-10-09 00:21:04
1238
原创 hdu 2022 海选女主角
海选女主角 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 26100 Accepted Submission(s): 11880 Problem Description potato老师虽然很喜欢教书,但是
2013-10-08 19:59:40
716
原创 hdu 2020 绝对值排序
绝对值排序 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 31254 Accepted Submission(s): 15436 Problem Description 输入n(n In
2013-10-08 16:53:39
1015
原创 hdu 2019 数列有序!
数列有序! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 35985 Accepted Submission(s): 15419 Problem Description 有n(n Input 输入
2013-10-06 16:35:16
936
原创 hdu 2018母牛的故事
母牛的故事 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 33586 Accepted Submission(s): 16569 Problem Description 有一头母牛,它每年年初生一头小母牛。每头
2013-10-06 11:54:29
634
转载 C语言各种数据类型在系统中占的字节和取值范围
基本类型包括字节型(char)、整型(int)和浮点型(float/double)。 定义基本类型变量时,可以使用符号属性signed、unsigned(对于char、int),和长度属性short、long(对于int、double)对变量的取值区间和精度进行说明。 下面列举了Dev-C++下基本类型所占位数和取值范围: 符号属性 长度属性 基本型
2013-10-06 10:54:48
1000
原创 hdu 2015 偶数求和
偶数求和 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 36010 Accepted Submission(s): 15665 Problem Description 有一个长度为n(n Input
2013-10-06 10:48:00
1587
原创 输出等边三角形
#include int main() { int n,i,j,k1,k2,k3; while(scanf("%d",&n)!=EOF) { for(i=1;i<n;i++) { k2=2*i-1; k1=k3=((2*n-1)-(2*i-1))/2; for(j=1;j
2013-10-04 13:43:06
1461
原创 线性表
#include #include #define OK 1 #define ERROR 0 #define TRUE 1 #define FLASE 0 #define OVERFLOW -2 typedef int Status; typedef int *Triplet; Status InitTrilplet(Triplet &T,int
2013-09-27 21:11:36
742
原创 hdu 2014 青年歌手大奖赛_评委会打分
青年歌手大奖赛_评委会打分 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 36719 Accepted Submission(s): 18025 Problem Description 青年歌手大奖赛中,评
2013-09-20 21:11:14
972
原创 hdu 1003 Max Sum
Max Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 116194 Accepted Submission(s): 26942 Problem Description Given a sequenc
2013-09-20 20:47:24
594
原创 hdu 2012 素数判定
素数判定 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 57847 Accepted Submission(s): 19910 Problem Description 对于表达式n^2+n+41,当n在(x
2013-09-20 14:30:56
753
原创 hdu A + B Problem II
A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 169696 Accepted Submission(s): 32544 Problem Description I have
2013-09-12 22:23:14
570
原创 复数输出
这是课堂练习 #include #include "df.h"//文件命名为英文,不是汉字,不带符号 typedef struct { float x; float y; }complex; Status initcomplex (complex &z,float r,float i) { z.x=r; z.y=i; return
2013-09-11 17:51:26
990
原创 hdu 1161 Eddy's mistakes
Eddy's mistakes Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6152 Accepted Submission(s): 3491 Problem Description Eddy usually w
2013-08-22 14:24:45
734
原创 链表输出
自己试试手的,可以参考看看#include #include typedef struct LIST { int data; struct LIST *next; }S; int main() { S *head,*p,*q; int N,a; head = (LIST*)malloc(sizeof(LIST*)); scanf("%d",&N); p=(
2013-08-12 16:38:12
583
原创 poj 1862 Stripies
Stripies Time Limit: 1000ms Case Time Limit: 1000ms Memory Limit: 30000KB 64-bit integer IO format: %lld Java class name: Main Submit Status PID: 1981 Font Size: Ou
2013-08-11 17:07:52
564
原创 hdu 1236 排名
排名 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12822 Accepted Submission(s): 4779 Problem Description 今天的上机考试虽然有实时的Ranklist,但上
2013-08-10 19:53:02
656
原创 hdu Encoding
Encoding Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 16 Accepted Submission(s) : 13 Problem Description Given a string containing only
2013-08-09 16:38:42
741
原创 母函数模板
#include using namespace std; const int lmax=10000; int c1[lmax+1],c2[lmax+1]; //为节约储存空间,定义2个数组,实际为3个数组 int main() { int n,i,j,k; while (cin>>n) { for (i=0;i<=n;i++) {
2013-08-09 15:37:26
549
转载 C++ STL 的用法
C++ STL 的用法 上次遇到容器的运用,根本不会,然后学长和学弟(这个强人)到网上就找到了容器的用法和帮助文档,真是瞌睡来了就有人送枕头啊!!(PS:我找过C++的标准库文档,要么就是有问题打不开,要么就不是我要的。。哭。。。) 数据结构 描述 实现头文件 向量(vector) 连续存储的元素
2013-08-08 18:52:29
589
原创 利用栈进行进制转换
//十进制转化为二进制,利用栈先进后出原理 #include #include using namespace std; int main() { int n; stack s; while (scanf("%d",&n)!=EOF) { while (!s.empty()) s.pop();//一个一个清空栈顶元素 while(n>0) {
2013-08-08 16:19:13
739
原创 hdu Questions and answers
Questions and answers Time Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other) Total Submission(s) : 20 Accepted Submission(s) : 5 Problem Description The database of t
2013-08-05 21:08:22
756
原创 hdu Ignatius and the Princess II
Ignatius and the Princess II Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 2 Accepted Submission(s) : 1 Problem Description Now our hero
2013-08-05 16:18:48
827
原创 HDU DNA Sorting
DNA Sorting Time Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other) Total Submission(s) : 3 Accepted Submission(s) : 2 Problem Description One measure of ``unsortedness
2013-08-05 11:53:24
674
原创 hdu 排序
排序 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 17 Accepted Submission(s) : 6 Problem Description 输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格
2013-08-04 21:24:31
665
原创 hdu Who's in the Middle
排序 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 1 Accepted Submission(s) : 0 Problem Description 输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分
2013-08-04 14:38:47
604
转载 hdu Train Problem II
Train Problem II Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 0 Accepted Submission(s) : 0 Problem Description As we all know the Train
2013-08-02 17:05:22
770
原创 hdu A + B Problem II
A + B Problem II Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 5 Accepted Submission(s) : 1 Problem Description I have a very simple pro
2013-08-02 14:24:54
568
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人