1,C++中操作数组
#include
using namespace std;
int length(char []);
void output_frequency(char []);
int main()
{
char str[]="yan cong min";
cout<<"要处理的字符串为:"<<str<<endl;
cout<<"字符串长度为:"<<lengt...
分类:
编程语言 时间:
2014-05-05 13:29:30
阅读次数:
432
(最近水题刷的比较多,不过还是有些收获,所以还是做个记录比较好)
http://acm.hdu.edu.cn/showproblem.php?pid=1282
分析:
题目理解起来还是简单的,基本上有两种思路:1) 将int转为string来实现; 2)直接用int做(回文串判断,相加)
第二中思路比较直接,将一个数倒置得到新的数,然后判断是否是回文数...
分类:
其他好文 时间:
2014-05-05 13:26:07
阅读次数:
276
函数名
释义
介绍
htmlspecialchars
将与、单双引号、大于和小于号化成HTML格式
&转成&
"转成"
' 转成'
>转成>
htmlentities()
所有字符都转成HTML格式
除上面htmlspecialchars字符外,还包括双字节字符显示成编码等。
ad...
分类:
Web程序 时间:
2014-05-05 13:06:39
阅读次数:
414
本文出自:http://blog.csdn.net/svitter
括号匹配一:http://acm.nyist.net/JudgeOnline/problem.php?pid=2
括号匹配二:http://acm.nyist.net/JudgeOnline/problem.php?pid=15
之前被这个题目难住,现在看动态规划就顺便过来AC了它。结果发现当年被难住一点...
分类:
其他好文 时间:
2014-05-03 23:52:18
阅读次数:
408
译:
这是一个常见的问题,但是对于这个问题我没有找到一个很好的方法:如何将整数类型转化为字符串类型?我遇到过几种解决方案。我不会使用stringstream。sprintf()函数也遇到了问题,并且它是C语言的风格。函数itoa()以前工作地很好,但参考文档说:
这个函数在ANSI-C中没有被定义,并且它不是C++的一部分,但有些编译器支持并且这个函数也是C语...
分类:
其他好文 时间:
2014-05-03 17:46:11
阅读次数:
294
By Long Luo
最近遇到一个算法题:
仿照Excel的列编号,给出一个数字,输出该列编号字符串。
例如:A对应1,Z对应26,AA对应27,AZ对应52 ......
这个题目是一个典型的26进制思路去处理,但是这个题目里面有很多陷阱,在1, 26, 52等特殊情况进行考虑,经过晚上接近1个小时的编写,完成的代码如下:
C++代码如下:
#inclu...
分类:
其他好文 时间:
2014-05-03 17:09:18
阅读次数:
344
本文出自:http://blog.csdn.net/svitter
原题:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1053
题意:完全背包不解释。。直接贴代码。。
#include
#include
#include
using namespace std;
#defi...
分类:
其他好文 时间:
2014-05-03 16:06:14
阅读次数:
324
http://acm.hdu.edu.cn/showproblem.php?pid=1228
分析:
我只是想练习一下map的用法,不然又忘了。。。
代码:
//hdu 1228
#include
#include
#include
#include
#include
using namespace std;
map d;
void init()...
分类:
其他好文 时间:
2014-05-03 15:40:58
阅读次数:
232
TEX Quotes
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 8505
Accepted: 4460
Description
TEX is a typesetting language developed by Donald Knuth. It ta...
分类:
其他好文 时间:
2014-05-03 15:40:11
阅读次数:
296