编译时多态--函数重载
编译后生成的中间代码(如GCC生成的.o文件,此时还不是汇编语言)函数名字有变化,看下面两个例子。
void cc_show(const char*str) -> _Z7cc_showPKc
void cc_show(int x) -> _Z7cc_showi
大家可以看到,函数名其实不同,与返回值、函数名、参数有关。函数...
分类:
编程语言 时间:
2014-08-10 15:50:10
阅读次数:
273
给一组小括号与中括号的序列,添加最少的字符,使该序列变为合法序列,输出该合法序列。
dp[a][b]记录a-b区间内的最小值,
mark[a][b]记录该区间的最小值如何得到。
#include "stdio.h"
#include "string.h"
int inf=99999999;
char str[110];
int dp[110][110],mark[110][110]...
分类:
其他好文 时间:
2014-08-10 15:49:30
阅读次数:
203
指令号说明账号注册 100{username str 用户名password str 密码}返回信息{result bool 指令调用是否成功message str 指令调用返回的信息}账号登陆 101请求信息{username str 用户名password str 密码}返回信息{result....
string str = "aaa"; this.Literal1.Text = string.Format("{0}", str.Replace("", ">"));string str = "中国"; this.Literal1.Text = S...
分类:
Web程序 时间:
2014-08-10 15:28:10
阅读次数:
236
sql数据库自定义一个函数把下面代码写进去功能是得到汉字拼音首字母如下:123456789101112131415161718192021222324252627282930313233343536373839404142createfunctionfun_getPY(@str nvarchar(4...
分类:
数据库 时间:
2014-08-10 12:41:10
阅读次数:
477
php 将标准字符串格式时间转换成unix时间戳的函数为:strtotime函数(PHP 4, PHP 5)。 strtotime函数详细参考: strtotime — 将任何英文文本的日期时间描述解析为 Unix 时间戳. 函数格式说明: int strtotime ( str...
分类:
Web程序 时间:
2014-08-10 08:11:40
阅读次数:
265
【问题】
输入一个字符串,输出该字符串中字符的所有组合。举个例子,如果输入abc,它的组合有a、b、c、ab、ac、bc、abc。
【分析】
对于字符串中每个字符,只有两种情况:一种就是出现在组合中,一种是不出现在组合中。
【代码】
void combination(char *str, char *res, int strPos, int resPos, int size)
{...
分类:
其他好文 时间:
2014-08-09 23:23:20
阅读次数:
512
解题报告
题意:
略。
思路:
map应用。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
mapMap;
int main()
{
string str1,str2,str;
int i,j;
while...
分类:
其他好文 时间:
2014-08-09 21:34:19
阅读次数:
277
说到底就是一个大数乘幂运算,小数点后零。明白大数乘幂算法直接搞。 这里就有几个问题: 1.幂位数小可以用二进制容器表示(取模更好,但我是为了练习STL) 2.n位大数用string表示,外加一个int型表示小数点位置 3.字符串×字符串用小学竖式乘法算法就行,注意补零。位数多时两个str...
分类:
其他好文 时间:
2014-08-09 18:30:08
阅读次数:
340
对window.open进行封装, 使其更好用, 且更兼容, 很多人说window.open不兼容,其实不是, 因为不能直接执行, 必须通过用户手动触发才行;看代码: 代码如下 复制代码 var openWindow = function(url, options) { var str = "...
分类:
编程语言 时间:
2014-08-09 18:08:28
阅读次数:
294