摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 1. Elementary Problem Solving::Sorting/Searching// 299 - Train Swapping#include using namesp... 阅读全文
posted @ 2014-08-09 17:39 颜威 阅读(70) 评论(0) 推荐(0) 编辑
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 1. Elementary Problem Solving::Sorting/Searching// 10474 - Where is the Marble?#include #inc... 阅读全文
posted @ 2014-08-09 17:39 颜威 阅读(106) 评论(0) 推荐(0) 编辑
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 1. Elementary Problem Solving::Big Number// 748 - Exponentiation// bug:底数R必须带小数点,否则运算结果不对#in... 阅读全文
posted @ 2014-08-09 17:35 颜威 阅读(108) 评论(0) 推荐(0) 编辑
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 1. Elementary Problem Solving::Big Number// 10106 - Product#include #include //#include #def... 阅读全文
posted @ 2014-08-09 17:32 颜威 阅读(100) 评论(0) 推荐(0) 编辑
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 1. Elementary Problem Solving::Big Number// 424 - Integer Inquiry#include #include using nam... 阅读全文
posted @ 2014-08-09 17:26 颜威 阅读(118) 评论(0) 推荐(0) 编辑
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 0. Getting Started// 10055 - Hashmat the Brave Warrior#include using namespace std;int main(... 阅读全文
posted @ 2014-08-07 16:12 颜威 阅读(105) 评论(0) 推荐(0) 编辑
摘要: // 程序5_1_1 WERTYU#include const char* s = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./"; //常量数组int main(void){ int i, c; while((c=getchar()... 阅读全文
posted @ 2014-08-04 20:09 颜威 阅读(145) 评论(0) 推荐(0) 编辑
摘要: // 程序4-1 组合数#include int f(int n){ int i, m = 1; for(i = 1; i #include #include int is_prime(int x) // 惯用命名{ int i, m; assert(x >= 0); //当... 阅读全文
posted @ 2014-08-04 08:40 颜威 阅读(209) 评论(0) 推荐(0) 编辑
摘要: // 程序3-1 逆序输出#include #define MAXN 100+10 // 保险int a[MAXN]; // 比较大的数组应尽量声明在main函数外int main(void){ int i, x, n=0; while(scanf("%d", &x)==1) ... 阅读全文
posted @ 2014-08-03 19:50 颜威 阅读(124) 评论(0) 推荐(0) 编辑
摘要: // 程序2-2 7744问题(1)#include #include int main(void){ int a, b, n; double m; for(a = 1; a int main(void){ int x, n, hi, lo; for(x = 1; ; ... 阅读全文
posted @ 2014-08-03 19:46 颜威 阅读(129) 评论(0) 推荐(0) 编辑