2012年8月7日

poj1686 Lazy Math Instructor

摘要: 1 #include<map> 2 #include<stack> 3 #include<cctype> 4 #include<iostream> 5 using namespace std; 6 map<char,int> m; //从字符映射到数字 7 string s1,s2,r1,r2; 8 string transform(string s)//把表达式转化为后缀表达式方便计算 9 {10 int i,j,len;11 char c[81];12 stack<char> exp; //定义一个字符栈,存放运算符 阅读全文

posted @ 2012-08-07 21:32 小花熊 阅读(604) 评论(1) 推荐(1) 编辑

poj1028 Web Navigation

摘要: Accepted360K16MSG++700B 1 #include<stdio.h> 2 #include<string.h> 3 char fs[100][71],bs[100][71]; 4 int ftop,btop; 5 int main() 6 { 7 char a[8],cur[71]; 8 strcpy(cur,"http://www.acm.org/"); 9 while(scanf("%s",a),strcmp(a,"QUIT")){10 if(!strcmp(a,"VISIT&q 阅读全文

posted @ 2012-08-07 16:23 小花熊 阅读(188) 评论(0) 推荐(0) 编辑

poj1250 Tanning Salon

摘要: 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 char c,p[26]; 6 int n,curnum,leave; 7 while(scanf("%d%*c",&n),n) 8 { 9 curnum=leave=0;10 memset(p,0,sizeof(p));11 for(c=getchar();c!='\n';c=getchar()){12 if(p[c-'A']==1){13 ... 阅读全文

posted @ 2012-08-07 11:25 小花熊 阅读(211) 评论(0) 推荐(0) 编辑

poj2082 Terrible Sets

摘要: 1 #include<stdio.h> 2 struct Node{ //定义堆栈 3 int w,h; //w为目前为止整个区域的宽度,h为当前矩形的高度 4 }stack[50001]; 5 int main() 6 { 7 int i,n,top,totalw; //top为栈顶指针,totalw为总的宽度 8 int curw,curh,maxsize; //curw,curh为新矩形高度,宽度。maxsize为当前最大矩形面积 9 while(scanf("%d",&n),n+1)10 {11 for(totalw=... 阅读全文

posted @ 2012-08-07 10:11 小花熊 阅读(409) 评论(0) 推荐(0) 编辑

导航