摘要: 主要是利用了字符的ascii码。以ascii码作为索引。代码:展开 1 import java.util.Scanner; 2 public class FindMostChar { 3 4 /** 5 * @author 王锦 6 * @Email jinksw@vip.qq.com 7 * @param args 8 */ 9 public static void main(String[] args) {10 // TODO Auto-generated method stub11 ... 阅读全文
posted @ 2013-04-26 20:35 Jinks 阅读(702) 评论(1) 推荐(0) 编辑
摘要: 当初学Java时做的。代码:展开 1 public class XiXueGuiNum { 2 3 /** 4 * @param args 5 */ 6 public static void main(String[] args) { 7 // TODO Auto-generated method stub 8 int num[] = new int[4]; 9 for(int i = 1000;i < 10000;++i){10 if(i%100 == 0)11 ... 阅读全文
posted @ 2013-04-26 20:17 Jinks 阅读(592) 评论(0) 推荐(0) 编辑
摘要: 当初的数据结构上机作业,题目很奇葩,要求先将中缀表达式转换成后缀表达式再求值。只加入了一些错误判断,因为输入的错误形式太多了,做到一半懒得做了。代码:展开 1 // 中缀表达式求值(通过先转换为后缀表达式再求值) 2 // 作者:王锦 3 // 邮箱:jinksw@vip.qq.com 4 5 #include "stdafx.h" 6 #include <stack> 7 #include <queue> 8 #include <iostream> 9 #include <sstream> 10 using namespac 阅读全文
posted @ 2013-04-26 15:26 Jinks 阅读(1206) 评论(0) 推荐(0) 编辑
摘要: 这是我学习数据结构时的一道上机作业,那时还没养成写注释的习惯,所以各位得受点苦了。只是简易背包问题。代码:展开 1 // 背包问题所有解 2 // 作者:王锦 3 // 邮箱:jinksw@vip.qq.com 4 5 #include "stdafx.h" 6 #include <iostream> 7 #include <stack> 8 #include <list> 9 using namespace std; 10 11 class BagProblemSolver 12 { 13 private: 14 int *stuffW 阅读全文
posted @ 2013-04-26 15:22 Jinks 阅读(724) 评论(0) 推荐(0) 编辑