闲的蛋疼,挑战一下Quine... - swgr's Blog

闲的蛋疼,挑战一下Quine...

swgr posted @ 2011年6月03日 18:42 in other with tags quine , 4894 阅读

刚睡醒,比较闲,小玩一下...

 
以下这段代码是一个C语言程序,它的输出是一个Java语言程序的源代码,这个Java程序的输出恰好是之前那个C语言程序的代码本身...
 
main(a,b){char c[1024];a="public class Main{public static void main(String[]args){String a=%%c%%s%%c;String b=%%c%%s%%c;String c=String.format(a);System.out.printf(c,34,b,34,34,a,34);}}";b="main(a,b){char c[1024];a=%%c%%s%%c;b=%%c%%s%%c;sprintf(c,a);printf(c,34,b,34,34,a,34);}";sprintf(c,a);printf(c,34,b,34,34,a,34);}
 
语法高亮的版本:(显然加上了缩进的话就不正确了...要跑还是得用上面那段)
main(a,b)
{
    char c[1024];

    a="public class Main                                      \
      {                                                       \
          public static void main(String[]args)               \
          {                                                   \
              String a=%%c%%s%%c;                             \
              String b=%%c%%s%%c;                             \
              String c=String.format(a);                      \
              System.out.printf(c,34,b,34,34,a,34);           \
          }
      }";
    b="main(a,b)                                              \
      {                                                       \
          char c[1024];                                       \
          a=%%c%%s%%c;                                        \
          b=%%c%%s%%c;                                        \
          sprintf(c,a);                                       \
          printf(c,34,b,34,34,a,34);                          \
      }";
    sprintf(c,a);
    printf(c,34,b,34,34,a,34);
}
 
 
最后附上对偶的Java代码(就是上面这个C语言程序的输出结果:)
 
public class Main{public static void main(String[]args){String a="main(a,b){char c[1024];a=%%c%%s%%c;b=%%c%%s%%c;sprintf(c,a);printf(c,34,b,34,34,a,34);}";String b="public class Main{public static void main(String[]args){String a=%%c%%s%%c;String b=%%c%%s%%c;String c=String.format(a);System.out.printf(c,34,b,34,34,a,34);}}";String c=String.format(a);System.out.printf(c,34,b,34,34,a,34);}}
 
语法高亮的版本:
public class Main
{
    public static void main(String[]args)
    {
        String a="main(a,b)
                  {
                      char c[1024];
                      a=%%c%%s%%c;
                      b=%%c%%s%%c;
                      sprintf(c,a);
                      printf(c,34,b,34,34,a,34);
                  }";
        String b="public class Main
                  {
                      public static void main(String[]args)
                      {
                          String a=%%c%%s%%c;
                          String b=%%c%%s%%c;
                          String c=String.format(a);
                          System.out.printf(c,34,b,34,34,a,34);
                      }
                  }";
        String c=String.format(a);
        System.out.printf(c,34,b,34,34,a,34);
    }
}
 
注:两个编译器分别是gcc 3.4.5和jdk 1.6.0_23。
 
----------------------------------------------------  
 
后记:写完这段代码后,ACM_DIY群友[HIT]Larry告诉了我这么一个神一样的存在:
 
 
简介:这段ruby代码,相当牛,如作者所说,运行这段ruby,生成一段python代码,再运行python代码,生成一段perl代码,再运行perl代码,生成一段lua代码。。。这样一直下去,经过11种语言,最后。。。居然又能重新得到之前的ruby代码。。
 
这11种语言是:ruby 1.8.7-p72、Python 2.5.2、perl v5.10.0、Lua 5.0.3、OCaml 3.10.2、ghc-6.8.2、gcc 4.3.2、java “1.5.0_17″、beef 0.0.6-2、whitespace 0.3-2、unlambda 2.0.0-5。
Fermat 说:
2011年6月04日 22:22

好厉害!

jnanabhumiap.in 说:
2023年4月16日 15:51

We provide you the finest of web content on each and every topics possible with help of editorial and content team.Jnanabhumi AP is a startup by passionate webmasters and bloggers who have passion to provide engaging content which is accurate, interesting and worthy to read. We are mope like a web community where you can jnanabhumiap.in find different information’s, resources, topics on day to day incidents or news.

휴게소도메인 说:
2023年12月03日 13:56

Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has the same topic with your article. Thanks, great share

토토사이트 说:
2023年12月03日 14:29

I’m impressed, I have to admit. Truly rarely do I encounter a blog that’s both educative and entertaining, and without

아벤카지노 가입코드 说:
2023年12月03日 14:44

Your writing very well and provide a lot of useful information. But if you tap water more than half as compared to another article, I would definitely be great

메이저사이트홍보 说:
2023年12月03日 15:04

Surprising article. Hypnotizing to analyze. I genuinely love to analyze such a good article. Much regarded! keep shaking.

토토핫주소 说:
2023年12月03日 15:30

Surprising article. Hypnotizing to analyze. I genuinely love to analyze such a good article. Much regarded! keep shaking.

토토핫 주소 说:
2023年12月03日 15:39

You make so many great points here that I read your article a couple of times. This is great content for your readers.

먹튀사이트검증 说:
2023年12月03日 16:09

My brother recommended I might like this website. He was entirely right. This post actually made my day. You cannot imagine just how much time I had spent for this info! Thanks!

메이저놀이터검증 说:
2023年12月03日 16:45

Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work

메이저사이트 说:
2023年12月03日 16:55

Hello, My name is Neha Sehgal the hottest call girl in Indore who loves to serve you the ultimate sexual pleasure to the individuals. Our female Indore escort models are available 24×7 hours at a low rate and cash payment.

안전놀이터순위 说:
2023年12月03日 17:16

Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post .

먹튀검증백과 说:
2023年12月03日 17:17

In the wake of perusing your article I was stunned. I realize that you clarify it exceptionally well. What's more, I trust that different perusers will likewise encounter how I feel in the wake of perusing your article

카지노헌터 说:
2023年12月03日 18:04

You make so many great points here that I read your article a couple of times. This is great content for your readers.

먹튀폴리스주소 说:
2023年12月03日 18:20

There is so much in this article that I would never have thought of on my own.  Your content gives readers things to think about in an interesting way.  Thank you for your clear information.

카지노게임사이트 说:
2023年12月03日 18:36

I really loved reading your blog. It was very well authored and easy to understand. Unlike additional blogs I have read which are really not that good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he enjoyed it as well! https://gamma.app/public/Divine-Dialogue-Reviews-FAKE-SCAM-Dont-Buy-Must-Read-5088osfx0vfmgdz

사설토토사이트 说:
2023年12月03日 18:36

In the wake of perusing your article I was stunned. I realize that you clarify it exceptionally well. What's more, I trust that different perusers will likewise encounter how I feel in the wake of perusing your article

안전놀이터 说:
2023年12月03日 19:00

The idea thinks fully correct. Most of smaller sized features ended up made by way of a lot of file education and learning. I adore the approval a great deal.

메이저안전공원 说:
2023年12月03日 19:04

I really loved reading your blog. It was very well authored and easy to understand. Unlike additional blogs I have read which are really not that good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he enjoyed it as well! https://gamma.app/public/Divine-Dialogue-Reviews-FAKE-SCAM-Dont-Buy-Must-Read-5088osfx0vfmgdz

해외안전놀이터 说:
2023年12月03日 19:17

This may be the proper weblog for desires to find out about this topic. You know so much its virtually challenging to argue along (not too I really would want…HaHa). You definitely put a new spin for a topic thats been revealed for some time. Excellent stuff, just great!

메이저 가입코드 说:
2023年12月03日 19:33

fantastic points altogether, you just gained emblem reader. What would you suggest in regards to your post that you made a few days ago? Any certain?

เว็บพนันบอลออนอไลน์ 说:
2023年12月03日 19:40

Well-informed and composed content. I got such astounding data from the post. I will likewise say that the plan of the site is overall quite stacked rapidly. If you are looking for the same kind of information about bank account verification, you can read it on DIRO official website.

신규가입꽁머니 说:
2023年12月03日 19:44

Do you want to start trading Bitcoin but don't know how to go about it? You're in luck today because we've put together a brilliant tool that makes cryptocurrency trading easy. Whether you are a beginner just starting out or an experienced trader looking for a tool that will give you an edge in the highly volatile crypto market, you are invited to experience the incredible features of the Bitcoin Bank Breaker app to explore. 

입금플러스 说:
2023年12月03日 19:50

fantastic points altogether, you just gained emblem reader. What would you suggest in regards to your post that you made a few days ago? Any certain?

먹튀사이트 说:
2023年12月03日 19:52

This specific seems to be definitely excellent. These very small facts are produced using wide range of qualifications 

먹튀뱅크 说:
2023年12月03日 19:58

Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has the same topic with your article. Thanks, great share

토토검증 说:
2023年12月03日 20:14

These you will then see the most important thing, the application provides you a website a powerful important internet page

먹튀폴리스 说:
2023年12月03日 20:16

Do you want to start trading Bitcoin but don't know how to go about it? You're in luck today because we've put together a brilliant tool that makes cryptocurrency trading easy. Whether you are a beginner just starting out or an experienced trader looking for a tool that will give you an edge in the highly volatile crypto market, you are invited to experience the incredible features of the Bitcoin Bank Breaker app to explore. 

토토사이트추천 说:
2023年12月03日 20:36

In tense situations, a customer may be upset and speak quickly when reporting an incident. It is the responsibility of security to decipher what is being relayed and offer support so they feel safe and secure.

먹튀검증업체 说:
2023年12月03日 20:42

I don’t have time right now to write a lot, but when I returned tomorrow evening, I will explain in depth why I disagree with this article. 

먹튀검증의중요성 说:
2023年12月03日 20:59

Hello! I simply wish to make a huge thumbs up to the great information you’ve here for this post. I’ll be coming back to your website to get more detailed soon. 

우리카지노 说:
2023年12月03日 21:07

I don’t have time right now to write a lot, but when I returned tomorrow evening, I will explain in depth why I disagree with this article. 

토토사이트 说:
2023年12月03日 21:11

Wow, What an Outstanding post. I found this too much informatics. It is what I was seeking for. I would like to recommend you that please keep sharing such type of info.If possible, Thanks.

먹튀제보 说:
2023年12月03日 21:16

I’m impressed, I have to admit. Truly rarely do I encounter a blog that’s both educative and entertaining, and without a doubt, you’ve hit the nail on the head. Your notion is outstanding; the pain is an element that not enough folks are speaking intelligently about. My business is happy that I stumbled across this in my search for something regarding this. 

먹튀타운 说:
2023年12月03日 21:30

Thanks for sharing this quality information with us. I really enjoyed reading. Will surely going to share this URL with my friends. 

먹튀검증사이트 说:
2023年12月03日 21:40

Hello! I simply wish to make a huge thumbs up to the great information you’ve here for this post. I’ll be coming back to your website to get more detailed soon. 

메이저놀이터가입 및 이용방법 说:
2023年12月03日 21:44

I don’t have time right now to write a lot, but when I returned tomorrow evening, I will explain in depth why I disagree with this article. 

exam代考 说:
2024年1月12日 14:16

无论是Online代考还是Take-Home,无论是有摄像头的网课代考或者还是In class考试,我们都可以帮您! 可接24小时内考试代考急单,不达标立即退款!下单后建立项目群,直接跟学霸沟通需求;配备课程助手,随时反馈进度!

토토사이트 说:
2024年1月20日 13:39

I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post.

토토사이트 说:
2024年1月20日 15:15

Really i appreciate the effort you made to share the knowledge. The topic here i found was really effective to the topic which i was researching for a long time

슬롯사이트 说:
2024年1月20日 15:47

Really i appreciate the effort you made to share the knowledge. The topic here i found was really effective to the topic which i was researching for a long time

바카라사이트 说:
2024年1月20日 16:32

hi!! Extremely intriguing exchange happy that I ran over such useful post. Keep doing awesome. Happy to be a piece of your net group

온라인 카지노 说:
2024年1月20日 17:21

We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work

토토사이트 说:
2024年1月20日 17:57

Amazing website sir. A great information given by you in this blog. It really informative and very helpful. Thank you.

바카라 커뮤니티 说:
2024年1月20日 18:31

Awesome post! Blog Comment is a great way to exchange ideas

카지노뱅크 说:
2024年1月20日 18:47

Thanks for providing recent updates regarding the concern, I look forward to read more

토토사이트 说:
2024年1月20日 19:25

Thank you for this nice sharing.

카지노사이트 说:
2024年1月20日 20:06

I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work

industrial outdoor s 说:
2024年1月20日 20:44

Excellent Post! For more information

카지노 说:
2024年1月20日 21:22

You made some decent points there. I looked on the net to the issue and found most people may go as well as using your site.

소액결제현금화 说:
2024年1月21日 13:42

The information you have posted is very useful. The sites you have referred was good. Thanks for sharing

스포츠중계 说:
2024年1月21日 15:28

Nice post. I was continuously checking this blog and I am impressed! Extremely useful info particularly the last part .I care for such information much. I was seeking this particular info for a long time. Thank you and good luck .

카지노사이트 说:
2024年1月21日 15:58

"If you are going for most excellent contents like myself,
just pay a visit this web page every day as it gives feature contents,
thanks"

스포츠중계 说:
2024年1月22日 16:22

It's always exciting to read articles from other writers and practice something from their web sites.

마사지 说:
2024年1月24日 16:07

Hi, I log on to your new stuff like every week. Your humoristic style is witty, keep it up

토토사이트 说:
2024年1月24日 19:22

Thanks for a wonderful in addition to enlightening post We truly value all the effort which went into creating.

카지노 说:
2024年1月26日 11:03

카지노 바카라사이트 우리카지노 카지노는 바카라, 블랙잭, 룰렛 및 슬롯 등 다양한 게임을 즐기실 수 있는 공간입니다. 게임에서 승리하면 큰 환호와 함께 많은 당첨금을 받을 수 있고, 패배하면 아쉬움과 실망을 느끼게 됩니다.

하노이 밤문화 说:
2024年1月26日 11:06

하노이 꼭 가봐야 할 베스트 업소 추천 안내 및 예약, 하노이 밤문화 에 대해서 정리해 드립니다. 하노이 가라오케, 하노이 마사지, 하노이 풍선바, 하노이 밤문화를 제대로 즐기시기 바랍니다. 하노이 밤문화 베스트 업소 요약 베스트 업소 추천 및 정리.

마사지 说:
2024年1月27日 13:52

Great info! I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have

무료스포츠중계 说:
2024年1月27日 14:09

Your blog is too much amazing. I have found with ease what I was looking. Moreover, the content quality is awesome. Thanks for the nudge!

토토사이트 说:
2024年1月27日 14:23

Excellent article. Very interesting to read. I really love to read such nice article. Thanks! keep rocking

먹튀검증 说:
2024年1月29日 10:15

No.1 먹튀검증 사이트, 먹튀사이트, 검증사이트, 토토사이트, 안전사이트, 메이저사이트, 안전놀이터 정보를 제공하고 있습니다. 먹튀해방으로 여러분들의 자산을 지켜 드리겠습니다. 먹튀검증 전문 커뮤니티 먹튀클린만 믿으세요!!

베트남 밤문화 说:
2024年1月29日 10:19

베트남 남성전용 커뮤니티❣️ 베트남 하이에나 에서 베트남 밤문화를 추천하여 드립니다. 베트남 가라오케, 베트남 VIP마사지, 베트남 이발관, 베트남 황제투어 남자라면 꼭 한번은 경험 해 봐야할 화끈한 밤문화로 모시겠습니다.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee