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

推荐订阅源

P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
Cisco Talos Blog
Cisco Talos Blog
Schneier on Security
Schneier on Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy & Cybersecurity Law Blog
Know Your Adversary
Know Your Adversary
NISL@THU
NISL@THU
Scott Helme
Scott Helme
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Latest news
Latest news
P
Proofpoint News Feed
P
Palo Alto Networks Blog
K
Kaspersky official blog
I
Intezer
The Last Watchdog
The Last Watchdog
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
小众软件
小众软件
G
GRAHAM CLULEY
Last Week in AI
Last Week in AI
量子位
IT之家
IT之家
F
Full Disclosure
T
Threatpost
Hacker News: Ask HN
Hacker News: Ask HN
W
WeLiveSecurity
Y
Y Combinator Blog
V
V2EX
L
LINUX DO - 热门话题
Martin Fowler
Martin Fowler
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
Google DeepMind News
Google DeepMind News
博客园 - Franky
M
MIT News - Artificial intelligence
爱范儿
爱范儿
I
InfoQ
C
Cisco Blogs
L
LangChain Blog
J
Java Code Geeks
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Vercel News
Vercel News
Hugging Face - Blog
Hugging Face - Blog
S
Secure Thoughts
A
About on SuperTechFans

博客园 - GwQ

微软面试智力题(5) 微软面试智力题(4) 微软面试智力题(3) 微软面试智力题(2) 微软面试智力题(1) 微软面试技术题(0) 微软面试技术题(5) 微软面试技术题(4) 微软面试技术题(22) 微软面试技术题(20) 微软面试技术题(19) 微软面试技术题(18) 微软面试技术题(17) 微软面试技术题(16) 微软面试技术题(15) 微软面试技术题(14) 微软面试技术题(13) 微软面试技术题(12) 微软面试技术题(11)
微软面试技术题(21)
GwQ · 2006-06-17 · via 博客园 - GwQ

不重复地输出升序数组中的元素。

 1 void  outputUnique( char [] str, int  n) {
 2      if (n <= 0 return ;
 3     elseif(n == 1 ) putchar(str[ 0 ]);
 4      else   {
 5          int  i = 0 ,j = 1 ;
 6         putchar(str[ 0 ]);
 7          while (j < n) {
 8              if (str[j] !== str[i]) {
 9                 putchar(str[j]);
10                 i = j;
11             }

12              ++ j;
13         }

14     }

15 }