惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

博客园 - o0myself0o

利用线程池实现多客户端和单服务器端Socket通讯(二):异步编程模型实现 生产者消费者模式,代码中碰到的疑问(已解决) 利用线程池实现多客户端和单服务器端Socket通讯(一):同步方式 Entity Framework 4.0 ObjectContext下的各种方法实践 题目:若干个不重复数,打乱顺序输出 wtf js(四) - o0myself0o - 博客园 wtf js(三) number的类型不是number wtf js(二) 算法:给定两个已从小到大排好序的整型数组arrA和arrB,将两个数组合并成arrC,使得arrC也要按从小到大的顺序排好序 应用中的单例模式 javascript面向对象编程(一) - o0myself0o - 博客园 wtf js(一) - o0myself0o - 博客园 社区网站功能实现系列(三):社区页面无刷新回发的一种实现方式 社区网站功能实现系列(二):社区内容分享到别的SNS 社区网站功能实现系列(一):多国语言的实现 反射获取Class中Property的值 A*寻路初探 闲谈ASP.NET 2.0缓存技术 使用 jQuery 简化 Ajax 开发
面试题:给你三个bool类型变量a, b, c,判断至少有两个为true
o0myself0o · 2010-06-25 · via 博客园 - o0myself0o

1.

  return (a&&b) || (b&&c) || (a&&c);

2. 

  int count = 0;

  if(a) count++;

  if(b) count++;

  if(c) count++;

  return count >= 2;

3.  卡诺图

  return a?(b||c):(b&&c);

4.

  return a==b?a:c;

5. 异或(与4的条件相反)

  return a^b?c:a;

6.

  return (a?1:0)+(b?1:0)+(c?1:0) >= 2;

7. 与或

  return (a&b) | (b&c) | (a&c);

8. (3的变种)

  return (a&&(b||c)) || (b&&c);

你们还想到哪些呢?在留言里告诉我吧,谢谢~:)