2012年8月2日

poj1363 Rails

摘要: 1 #include<stdio.h> 2 int main() 3 { 4 int Sq[1000],a[1000]; 5 int i,k,n,head; 6 while(~scanf("%d",&n),n){ 7 while(scanf("%d",&a[0]),a[0]){ 8 for(head=0,i=1;i<n;++i) 9 scanf("%d",&a[i]);10 for(i=1,k=0;k<n;++k){11 while(i<a[... 阅读全文

posted @ 2012-08-02 16:47 小花熊 阅读(223) 评论(0) 推荐(0) 编辑

nyoj128 前缀式计算

摘要: 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 #define N 1010 5 char s[N]; 6 //数字栈的操作 7 typedef struct 8 { 9 float *base; 10 float *top; 11 }SqStack; 12 int InitStack(SqStack &S) 13 { 14 S.base=(float *)malloc(N/2*sizeof(float)); 15 S.top=S.base; 16 return 1; 1 阅读全文

posted @ 2012-08-02 10:14 小花熊 阅读(196) 评论(0) 推荐(0) 编辑

nyoj467 中缀式变后缀式

摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 #define N 1010 4 //字符栈的操作 5 typedef struct 6 { 7 char *base; 8 char *top; 9 }SqStack; 10 int InitStack(SqStack &S) 11 { 12 S.base=(char *)malloc(N*sizeof(char)); 13 if(!S.base) exit(1); 14 S.top=S.base; 15 return 1; 16 } 17 int StackE... 阅读全文

posted @ 2012-08-02 08:39 小花熊 阅读(317) 评论(0) 推荐(0) 编辑

nyoj267 郁闷的C小加(二)

摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 #define N 1010 4 char s[N]; 5 int i; 6 //字符栈的操作 7 typedef struct 8 { 9 char *base; 10 char *top; 11 }SqStack1; 12 int InitStack1(SqStack1 &S) 13 { 14 S.base=(char *)malloc(N*sizeof(char)); 15 if(!S.base) exit(1); 16 S.top=S.base; 17 ... 阅读全文

posted @ 2012-08-02 08:37 小花熊 阅读(260) 评论(0) 推荐(0) 编辑

nyoj35 表达式求值

摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 #define N 1010 4 char s[N]; 5 //字符栈的操作 6 typedef struct 7 { 8 char *base; 9 char *top; 10 }SqStack1; 11 int InitStack1(SqStack1 &S) 12 { 13 S.base=(char *)malloc(N*sizeof(char)); 14 if(!S.base) exit(1); 15 S.top=S.base; 16 return 1; ... 阅读全文

posted @ 2012-08-02 08:36 小花熊 阅读(347) 评论(0) 推荐(0) 编辑

nyoj257 郁闷的C小加(一)

摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 #define N 1010 4 //字符栈的操作 5 typedef struct 6 { 7 char *base; 8 char *top; 9 }SqStack; 10 int InitStack(SqStack &S) 11 { 12 S.base=(char *)malloc(N*sizeof(char)); 13 if(!S.base) exit(1); 14 S.top=S.base; 15 return 1; 16 } 17 int StackE... 阅读全文

posted @ 2012-08-02 08:36 小花熊 阅读(252) 评论(0) 推荐(0) 编辑

导航