上面的是if else 和 switch的两种写法,switch略优。 改写&&与|| 更简洁的写法 ...
分类:
Web程序 时间:
2017-04-07 00:54:10
阅读次数:
163
for循环 JavaScript 提供多种遍历语法。最原始的写法就是for循环。 缺点:这种写法比较麻烦 forEach 数组提供内置的forEach方法 缺点:这种写法的问题在于,无法中途跳出forEach循环,break命令或return命令都不能奏效。 for...in for…in 用于遍历 ...
分类:
Web程序 时间:
2017-04-07 00:53:53
阅读次数:
264
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr ...
分类:
其他好文 时间:
2017-04-06 23:31:33
阅读次数:
146
#include <stdio.h>#include <stdlib.h>#include <memory.h>#include <pthread.h>#include <errno.h>#include <math.h>//筷子作为mutexpthread_mutex_t chopstick[6] ...
分类:
其他好文 时间:
2017-04-06 16:33:20
阅读次数:
204
奥黛丽赫本的十部经典电影 1.《罗马假日》 (Roman Holiday,1953) 导演:威廉·惠勒 风情指数★★★★★ 看点:奥黛丽·赫本和格里高利·派克的完美组合 如果没有奥黛丽·赫本,或许《罗马假日》只会作为一部平庸的二流爱情电影被少数人记得。但是有了赫本,一切变得不同。23岁的赫本,把这个 ...
分类:
其他好文 时间:
2017-04-06 09:38:17
阅读次数:
194
/*百鸡问题*/#include<stdio.h>#include<stdlib.h>int main(void){ int x,y,z; printf("\n"); for(x=1;x<20;++x) { for(y=1;y<33;y++) { z=100-x-y; if((z%3==0)&&(( ...
分类:
其他好文 时间:
2017-04-06 01:21:31
阅读次数:
145
5. 自定义协议编程 (1)自定义协议:MSG (2)自定义读写函数 ①extern int write_msg(int sockfd, char* buff, size_t len); //发送一个基于自定义协议的message,发送的数据存放在buff中 ②extern int read_msg ...
分类:
系统相关 时间:
2017-04-05 23:21:15
阅读次数:
354
题意: 思路:如上 From http://blog.csdn.net/regina8023/article/details/44243911 最后的F(x,y)的推法和求gcd(x,y)=1的(x,y)对数差不多,只不过在推导过程中把原来1的地方换成x*y。 那么我们预处理出i^2*u[i]的前缀 ...
分类:
其他好文 时间:
2017-04-05 21:48:09
阅读次数:
194
实现员工的添加,查询和删除,并用dgvList显示出来 2.2 ...
分类:
其他好文 时间:
2017-04-05 16:54:54
阅读次数:
198