• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
mengxm
博客园    首页    新随笔    联系   管理    订阅  订阅
2011年6月9日
poj1363
摘要: http://poj.org/problem?id=1363通过栈模拟,检验有无可能实现输入和输出 1 #include<stdio.h> 2 int sum; 3 int *in,*out,*stack; 4 int inpoint,outpoint,stackpoint; 5 int is_ok() 6 { 7 inpoint=-1,outpoint=0,stackpoint=-1; 8 while(outpoint<sum) 9 {10 if(stackpoint>-1)11 {12 while(out[outpoint]!=stack[stackpoint]&a 阅读全文
posted @ 2011-06-09 23:49 mengxm 阅读(343) 评论(0) 推荐(0)
poj1102
摘要: http://poj.org/problem?id=1102简单模拟 1 #include<stdio.h> 2 #include<string.h> 3 char n1[11]="- -- -----"; 4 char n2[21]="|| | | |||| | |||||"; 5 char n3[11]=" ----- --"; 6 char n4[21]="|| || | | ||| ||| |"; 7 char n5[11]="- -- -- --"; 8 voi 阅读全文
posted @ 2011-06-09 23:44 mengxm 阅读(185) 评论(0) 推荐(0)
poj1028
摘要: http://poj.org/problem?id=1028一道栈模拟题目,要注意地方只有一个,就是当在栈中某处访问新地址后,不能再访问栈此处之后的地址,只能访问之前的。 1 #include<stdio.h> 2 char str[200][71]={"http://www.acm.org/"}; 3 int point=0,end=0; 4 void forword() 5 { 6 if(point>=end) printf("Ignored\n"); 7 else printf("%s\n",str[++poi 阅读全文
posted @ 2011-06-09 23:24 mengxm 阅读(507) 评论(1) 推荐(1)
poj1008
摘要: http://poj.org/problem?id=1008一道日历转换题,要注意%和/符号的运用,还要注意一年的最后一天在/运算符的作用下算作第二年,给数据:4. uayet 259正解是 13 ahau 364而不是13 ahau 365 1 #include<stdio.h> 2 #include<string.h> 3 char month_Haab[19][20]={"pop","no","zip","zotz","tzec","xul",& 阅读全文
posted @ 2011-06-09 23:05 mengxm 阅读(617) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3