NYOJ-35-表达式求值

摘要: NYOJ-35-表达式求值http://acm.nyist.net/JudgeOnline/problem.php?pid=35很好的一题,利用栈来计算表达式的值四则运算的规则:1.先乘除,后加减;2.从左算到右;3.先括号内,后括号外注意把字符串转换成浮点数可以使用atof函数#include<stdio.h> #include<string.h> #include<stdlib.h> int map[7][7]= //算符间的优先关系,100表示不会出现的情况 { {1,1,-1,-1,-1,1,1}, {1,1,-1,-1,-1,1,1}, {1,1, 阅读全文
posted @ 2012-06-18 21:36 java课程设计例子 阅读(154) 评论(0) 推荐(0)

AOJ-579-期末考试之考试传纸条

摘要: AOJ-579-期末考试之考试传纸http://icpc.ahu.edu.cn/OJ/Problem.aspx?id=579BFS,按模版写的,比赛时数据输入处理弄错了,哎。。。太弱了。。。#include<stdio.h> #include<string.h> #include<stdlib.h> int n,m; char map[105][105]; int ans[105][105]; int dir[4][2]={{-1,0},{1,0},{0,-1},{0,1}}; typedef struct { int x; int y; }node; in 阅读全文
posted @ 2012-06-18 00:57 java课程设计例子 阅读(301) 评论(0) 推荐(0)