Q3,12类似,Q7简单&我知道答案对于其他人 请帮助 擦拭回复。I found these questions on a web site and wish to share with all of uout there,Can SomeOne Solve these Porgramming puzzles.Programming PuzzlesSome companies certainly ask for these things. Specially Microsoft.Here are my favorite puzzles. Don''t send me emails asking for thesolutions.Q1 Write a "Hello World" program in ''C'' without using a semicolon.Q2 Write a C++ program without using any loop (if, for, while etc) toprint numbers from 1 to 100 and 100 to 1;Q3 C/C++ : Exchange two numbers without using a temporary variable.Q4 C/C++ : Find if the given number is a power of 2.Q5 C/C++ : Multiply x by 7 without using multiplication (*) operator.Q6 C/C++ : Write a function in different ways that will return f(7) =4 and f(4) = 7Q7 Remove duplicates in arrayQ8 Finding if there is any loop inside linked list.Q9 Remove duplicates in an no key access database without using anarrayQ10 Write a program whose printed output is an exact copy of thesource. Needless to say, merely echoing the actual source file is notallowed.Q11 From a ''pool'' of numbers (four ''1''s, four ''2''s .... four ''6''s),each player selects a number and adds it to the total. Once a numberis used, it must be removed from the pool. The winner is the personwhose number makes the total equal 31 exactly.Q12 Swap two numbers without using a third variable.Given an array (group) of numbers write all the possible sub groups ofthis group.Q14 Convert (integer) number in binary without loops.Q3,12 are similar , Q7 is simple & I know there answer For the Restplease HelpWiating for reply.推荐答案 Jatinder< js ******* @ sancharnet.in>在comp.lang.c上潦草地写下以下 :Jatinder <js*******@sancharnet.in> scribbled the followingon comp.lang.c:我在一个网站上发现了这些问题,并希望与你分享所有的内容,可以SomeOne解决了这些Porgramming难题。 编程拼图有些公司肯定要求这些东西。特别是微软。以下是我最喜欢的谜题。不要给我发电子邮件询问解决方案。 Q1写一个Hello World不使用分号在C中编程。 Q2编写C ++程序而不使用任何循环(if,for,while等)来打印1到100和100到1之间的数字; 在comp.lang.c上完成死亡。 Q4 C / C ++:查找给定数字是否为2的幂。 使用一些按位算术很简单。 Q5 C / C ++:乘以x而不使用乘法(*)运算符。 轻松自大。重复添加就可以了。 Q6 C / C ++:用不同的方式写一个函数,返回f(7)= 4和f(4)= 7 int f(int x){ 返回x == 4? 7:x == 7? 4:0; } Q7删除数组中的重复项 你不能从数组中删除任何东西。您只能修改其元素的 值。 Q8查找链表中是否有任何循环。 应涵盖在任何基础数据结构课程中。 Q9在不使用数组的情况下删除无密钥访问数据库中的重复项 无法访问无密钥访问数据库是不可能的。 Q10编写一个程序,其打印输出是源的精确副本。不用说,仅仅回显实际的源文件是不允许的。 Google forquine。 Q11来自''池''的数字(四''1',四''2 '...'4''6'),每个玩家选择一个数字并将其加到总数中。使用数字后,必须将其从池中删除。获胜者是,其总数等于31。 这个实际上是一个成熟的游戏。 Q12交换两个数字而不使用第三个变量。 这与Q3有什么不同? 给定一个数组(组)编写所有可能的子组这个组。 搜索电源组的定义。这个算法太难理解了。 Q14二进制转换(整数)数字没有循环。 I found these questions on a web site and wish to share with all of u out there,Can SomeOne Solve these Porgramming puzzles. Programming Puzzles Some companies certainly ask for these things. Specially Microsoft. Here are my favorite puzzles. Don''t send me emails asking for the solutions. Q1 Write a "Hello World" program in ''C'' without using a semicolon. Q2 Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1; Q3 C/C++ : Exchange two numbers without using a temporary variable.Done to death here on comp.lang.c. Q4 C/C++ : Find if the given number is a power of 2.Easy with some bitwise arithmetic. Q5 C/C++ : Multiply x by 7 without using multiplication (*) operator.Easy peasy. Repeated addition will do the trick. Q6 C/C++ : Write a function in different ways that will return f(7) = 4 and f(4) = 7int f(int x) {return x==4 ? 7 : x==7 ? 4 : 0;} Q7 Remove duplicates in arrayYou can''t remove anything from an array. You can only modify thevalues of its elements. Q8 Finding if there is any loop inside linked list.Should be covered in any basic data structures course. Q9 Remove duplicates in an no key access database without using an arrayImpossible without access into a no key access database. Q10 Write a program whose printed output is an exact copy of the source. Needless to say, merely echoing the actual source file is not allowed.Google for "quine". Q11 From a ''pool'' of numbers (four ''1''s, four ''2''s .... four ''6''s), each player selects a number and adds it to the total. Once a number is used, it must be removed from the pool. The winner is the person whose number makes the total equal 31 exactly.This one is actually a full-blown game. Q12 Swap two numbers without using a third variable.And how is this any different from Q3? Given an array (group) of numbers write all the possible sub groups of this group.Search for the definition of a "power set". The algorithm shoudln''t betoo hard to figure out. Q14 Convert (integer) number in binary without loops. 已在comp.lang.c上完成。 - / - Joona Palaste(pa ***** @ cc.helsinki.fi)-------------芬兰-------- \ \-- http://www.helsinki.fi/~palaste ------------ ---------规则! -------- / 这不对。这甚至都不错。 - Wolfgang PauliAlready done here on comp.lang.c.--/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/"This isn''t right. This isn''t even wrong."- Wolfgang Pauli文章< 22 ********* *****************@posting.google.com>, js ******* @ sancharnet.in (Jatinder)写道:In article <22**************************@posting.google.com >, js*******@sancharnet.in (Jatinder) wrote:我在网站上发现了这些问题并希望与大家分享在那里,CanOneOne可以解决这些Porgramming难题。 编程难题 有些公司当然会要求这些东西。特别是微软。以下是我最喜欢的谜题。不要给我发电子邮件询问解决方案。 Q1写一个Hello World不使用分号在C中编程。 Q2编写C ++程序而不使用任何循环(if,for,while等)来打印1到100和100到1之间的数字; Q4 C / C ++:查找给定数字是否为2的幂。 Q5 C / C ++:乘以x乘以7不使用乘法(*)运算符。 Q6 C / C ++:用不同的方式写一个函数,返回f(7)= 4和f(4)= 7 Q7删除重复项数组 Q8查找链表中是否有循环。 Q9删除无密钥访问数据库中的重复项而不使用数组 Q10编写打印输出为的程序来源的精确副本。毋庸置疑,仅仅回应实际的源文件是不允许的。 Q11来自数字池的数字(四个'1',四个''2'的.. ..四个''6'),每个玩家选择一个数字并将其添加到总数中。使用数字后,必须将其从池中删除。获胜者是,其总数等于31。 Q12交换两个数字而不使用第三个变量。给定数组(组)编写所有可能的子组这个组。 Q14转换(整数)二进制数无循环。 Q3,12类似,Q7简单&我知道答案对于其他人请帮助 I found these questions on a web site and wish to share with all of u out there,Can SomeOne Solve these Porgramming puzzles. Programming Puzzles Some companies certainly ask for these things. Specially Microsoft. Here are my favorite puzzles. Don''t send me emails asking for the solutions. Q1 Write a "Hello World" program in ''C'' without using a semicolon. Q2 Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1; Q3 C/C++ : Exchange two numbers without using a temporary variable. Q4 C/C++ : Find if the given number is a power of 2. Q5 C/C++ : Multiply x by 7 without using multiplication (*) operator. Q6 C/C++ : Write a function in different ways that will return f(7) = 4 and f(4) = 7 Q7 Remove duplicates in array Q8 Finding if there is any loop inside linked list. Q9 Remove duplicates in an no key access database without using an array Q10 Write a program whose printed output is an exact copy of the source. Needless to say, merely echoing the actual source file is not allowed. Q11 From a ''pool'' of numbers (four ''1''s, four ''2''s .... four ''6''s), each player selects a number and adds it to the total. Once a number is used, it must be removed from the pool. The winner is the person whose number makes the total equal 31 exactly. Q12 Swap two numbers without using a third variable. Given an array (group) of numbers write all the possible sub groups of this group. Q14 Convert (integer) number in binary without loops. Q3,12 are similar , Q7 is simple & I know there answer For the Rest please Help 假设这些问题来自于编程的面试 工作,我必须说,他们中的大多数人在找到一个优秀的程序员时非常无用。第三季:正确的答案是:为什么有人想要这样做?呢?问Q10:你知道答案,或者你不知道答案。如果你的名字是 G?del或图灵,你可能会找到自己的解决方案,但是否则这只是测试一些非常模糊的知识。我想这些问题只是用来检查你对压力情况的反应(这也是一个非常无用的方式找到一个优秀的程序员)。 如果给我这个问题列表,我会告诉他们大部分 他们都没有意义然后检查Q11,因为它是唯一的 有趣的一个。如果你急需一份 的工作,也许会有不同的回应。Assuming that these questions are from an interview for a programmingjob, I must say that most of them are incredibly useless at finding agood programmer. Take Q3: The correct answer is: Why would anyone wantto do that? Take Q10: You know the answer or you don''t. If your name isG?del or Turing, you might find a solution on your own, but otherwisethis just tests some very obscure knowledge. I guess these questions areonly used to check your reaction to a stressful situation (which is alsoan incredibly useless way at finding a good programmer).If I was given this list of questions, I would tell them that most ofthem are pointless and then examine Q11, because it is the onlyinteresting one. Maybe a different response if you are desperate for ajob." Joona I Palaste" < PA ***** @ cc.helsinki.fi>在消息新闻中写道:cbkf50"Joona I Palaste" <pa*****@cc.helsinki.fi> wrote in message news:cbkf50 这篇关于编程拼图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-28 01:23