指针数组 && 数组指针
char (*ptr)[5]; //定义一个指向数组指针ptr,指向包含5个char类型的数组
char *a[5]; //定义一个指针数组a,包含5个char*类型指针
#include
int main(void)
{
char *a[5]={"red","white","blue","dark","green"};
pri...
分类:
编程语言 时间:
2014-08-19 12:55:44
阅读次数:
230
问题:给定一个输入字符串,字符串字反向词。例如s = "the sky is blue",返回 "blue is sky the".我的答案:class Solution {public: void reverseWords(string &s) { if(s.size() r...
分类:
编程语言 时间:
2014-08-18 23:22:23
阅读次数:
450
Reverse Words in a String
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
click to show clarification.
...
分类:
其他好文 时间:
2014-08-18 16:20:32
阅读次数:
142
1. js没有块级作用域
if(true){
var color ="blue";
}
alert(color); //"blue"
for (var i=0; i<10 i++){
doSomething(i);
}
alert(i
对于块级作用域的语言来说,for语句初始化变量的表达所定义的变量,只会存在于循环的环境中。而对于JavaScript来说,由for语句创建的变量i即使在...
分类:
编程语言 时间:
2014-08-18 12:31:24
阅读次数:
171
html:on mouseover="show(this,'red')";on mouseout="show(this,'blue')";onclik="show(this,'yellow')";JS:这个例题是在看一节JS视频的时候看到的,如果是让我来写,我就会每一个事件调用一个函数。这样代码会比...
分类:
其他好文 时间:
2014-08-17 21:20:22
阅读次数:
180
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4822Problem DescriptionThree countries, Red, Yellow, and Blue are in war. The map of battlefield is a t...
分类:
其他好文 时间:
2014-08-16 16:19:50
阅读次数:
275
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers ...
分类:
其他好文 时间:
2014-08-16 12:35:30
阅读次数:
233
问题描述:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".解题思路:先利用split()方法将句子按空格分为...
分类:
其他好文 时间:
2014-08-16 11:08:40
阅读次数:
229
Blue Jeans
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 12233
Accepted: 5307
Description
The Genographic Project is a research partnership between IBM and...
分类:
其他好文 时间:
2014-08-15 18:01:49
阅读次数:
248
# include
# include
# include
using namespace std;
int next[100];
char pat[100];
char a[100][100];
int ma;
int lenp;
int n;
void Getnext()
{
int i=0,j=-1;
next[0]=-1;
while(i<=lenp)
...
分类:
其他好文 时间:
2014-08-15 16:01:18
阅读次数:
176