摘要: 又是一道让我心碎的题。UVA上提交了10几次都错了,在北大上又过了。用栈做的,在处理输入和判断括号上感觉还蛮良好的。#include #include #define MAXN 10000int stack[MAXN];int topc, top, t;bool judge() { int ... 阅读全文
posted @ 2013-01-26 22:32 zcube 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 在纸上画了下,用全等三角形定则,找了下规律。#include #include double compute(double x1, double y1, double x2, double y2) { return (x1+x2+y1-y2)/2;}int main() { doubl... 阅读全文
posted @ 2013-01-26 22:26 zcube 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 汝佳哥把这道题归为数论。按照题中的计算步骤,直接模拟就过了。#include #include #include int main() { char str[50]; while (scanf("%s", str) && str[0]!='0') { int len = ... 阅读全文
posted @ 2013-01-26 22:22 zcube 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 大数开方,结果不超过整型范围。我用的高精和二分在POJ通过了,在UVA没通过。后来在网上看到有大牛直接用double过了,实在让人佩服啊。我的代码:#include #include // 交换字符串函数void swap_str(char str[]) { int len = strlen... 阅读全文
posted @ 2013-01-26 22:18 zcube 阅读(150) 评论(0) 推荐(0) 编辑