Objective-C数组相关操作。// insert code here...NSLog(@"数组");//指定多个字符串创建数组NSArray *array;array=[NSArrayarrayWithObjects:@"0-asd",@"1-fds",@"2-哈咯",@"3-个人",nil]...
分类:
编程语言 时间:
2015-04-07 13:30:01
阅读次数:
151
原文:css优先级为什么要写这篇文章是因为 Here is a title! View Code 上面代码执行结果是这样的。按照我的理解,body在DOM中比html近,应该会按body h1中定义的绿色来显示文字,但是恰恰相反,文字颜色是紫色的。 原因现在我当然是知道的,因为css中优先级无视DO...
分类:
Web程序 时间:
2015-04-07 11:42:43
阅读次数:
231
点这里Here’s the 25 Best Weekly Web Design & Development Resources #18 Collective that aims to introduce fresh new, trendy and easy-to-use web design & d...
分类:
Web程序 时间:
2015-04-07 11:33:06
阅读次数:
290
为什么要写这篇文章是因为------------------------------------------- Here is a title!上面代码执行结果是这样的。按照我的理解,body在DOM中比html近,应该会按body h1中定义的绿色来显示文字,但是恰恰相反,文字颜色是紫色的。原.....
分类:
Web程序 时间:
2015-04-07 11:18:28
阅读次数:
154
uva 10739 String to PalindromeIn this problem you are asked to convert a string into a palindrome with minimum number of operations. The operations are described below:Here you’d have the ultimate free...
分类:
其他好文 时间:
2015-04-07 10:02:16
阅读次数:
119
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 ...
分类:
其他好文 时间:
2015-04-06 23:19:26
阅读次数:
176
链接:click here~~
题意:老鼠准备了M磅猫食,准备拿这些猫食跟猫交换自己喜欢的食物。有N个房间,每个房间里面都有食物。你可以得到J[i]单位的食物,但你需要付出F[i]单位的的猫食。 计算M磅猫食可以获得最多食物的重量。
【解题思路】贪心算法,求最优解。将J[i]/F[i]的值从大到小排列,每次取最大的,局部最优,达到全局最优,从而获得最大值。
代码:
// 贪心策略,优...
分类:
其他好文 时间:
2015-04-06 23:18:52
阅读次数:
218
比赛链接:click here~~
A BNU ACM校队时间安排,模拟自能
手速题:
#include
#include
#include
#include
#include
using namespace std;
int main()
{
int t;
scanf("%d", &t);
while (t--)
{
int tmp...
分类:
其他好文 时间:
2015-04-06 23:16:37
阅读次数:
197
链接:click here~~
题意:
题目大致意思是一个虫子掉在了一个n长度深的井中,然后它每分钟可以爬u长度,然后要休息一分钟,在此期间它会掉下d长度,问最终爬出井需要多久。
简单模拟:
代码:
#include
#include
#include
#include
#include
using namespace std;
int main()
{
int...
分类:
其他好文 时间:
2015-04-06 21:51:17
阅读次数:
196
A complete click-by-click, step-by-step video of this article is available here.OR… You can read the article, line-by-line.It all starts with a Linux....