本文纯属搞笑,如有雷同,纯属巧合。
/* normal-youth.c */
main() {
printf("hello world");
}
/* literature-youth.c */
int main(int argc, char** argv) {
printf("Hello world!\n");
return 0;
}
/* 2b-youth.c */
#define m main
#define p(x) printf(#x)
m(){p(hello world);}
// NormalYouth.java
public class NormalYouth {
public static void sayHello(String name) {
System.out.println("Hello, "+name);
}
}
// LiteratureYouth.java
/**
* Copyright 2011 Literature Youth
*
* Permission is granted to anyone who obtained a copy of this code.
* You may
* use,
* compile,
* modify
* and/or redistribute this code
* provided that you
* don't blame the Literature Youth for any consequences caused
* by using this code.
*/
package com.example.youth.literature.hello;
/**
* LiteratureYouth is a hello-saying object.
*/
public class LiteratureYouth {
private String name;
/**
* Get the name to say hello to.
* @return the name to say hello to.
*/
public getName() { return name; }
/**
* Set the name to say hello to.
* @param name the name to say hello to.
*/
public setName(String name) { this.name = name; }
/**
* Construct a LiteratureYouth object that says hello to name.
* @param name the name to say hello to.
*/
public LiteratureYouth(String name) {
super();
this.name = name;
}
/**
* Say hello to the pre-defined name.
*/
public void sayHello() {
System.out.println("Hello, "+name);
}
}
// TwoBiYouth.java
public class TwoBiYouth {
public static String name = "world";
private static TwoBiYouth instance = new TwoBiYouth();
public static TwoBiYouth getInstance() { return instance; }
public interface SayHelloStrategy {
void sayHello();
}
public class DefaultSayHelloStrategy implements SayHelloStrategy {
@Override public void sayHello() {
System.out.println("Hello, "+name);
}
}
private SayHelloStrategy strategy = new DefaultSayHelloStrategy();
public SayHelloStrategy getStrategy() { return strategy; }
public static class TwoBiYouthVisitor {
public void visit(TwoBiYouth tby) {
tby.getStrategy().sayHello();
}
}
public static class Facade {
public void sayHello(String n) {
TwoBiYouth.name = n;
TwoBiYouth tby = TwoBiYouth.getInstance();
TwoBiYouthVisitor visitor = new TwoBiYouthVisitor();
visitor.visit(tby);
}
}
}
# normal-youth.sql
SELECT 'Hello world';
# literature-youth.sql
SELECT 'Hello', name FROM hw WHERE p = 'Hello';
// 2bYouth.sql.java
conn.createStatement().execute(
"SELECT 'Hello', name FROM hw WHERE p = '"
+ scanner.next() + "';");
""" normal-youth.py """
def hello(name):
print "Hello", name
""" literature-youth.py """
def hello(name):
assert(sys.version_info.major == 2 and
sys.version_info.minor >= 6 or
sys.version_info.major > 2)
print "Hello {}".format(name)
""" 2b-youth.py """
hello = lambda n : (lambda v: v + " " + n)("Hello")
#!/bin/bash
# normal-youth.sh
# calculate 1+2+...+100
SUM=0
for n in {1..100}; do
SUM=$((SUM + n))
done
echo $SUM
#!/bin/bash
# literature-youth.sh
# calculate 1+2+...+100
for x in $(seq 100); do
for y in $(seq $x); do
echo $y
done
done | wc -l
#!/bin/bash
# 2b-youth.sh
# calculate 1+2+...+100
echo $((1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100))
-- NormalYouth.hs
factorial 0 = 1
factorial n = n * fac (n-1)
-- LiteratureYouth.hs
factorial n = foldr (*) 1 [1..n]
-- 2bYouth.hs
module Main where
data Natural = Zero | Succ Natural deriving Show
one = Succ Zero
two = Succ one
three = Succ two
four = Succ three
five = Succ four
six = Succ five
a +++ Zero = a
a +++ Succ x = Succ a +++ x
a *** Zero = Zero
a *** Succ x = a +++ (a *** x)
factorial Zero = one
factorial n@(Succ x) = n *** factorial x
toi Zero = 0
toi (Succ x) = 1 + toi x
分享到:
相关推荐
iPad阅读应用横向评测:普通&2B&文学青年的碰撞.docx
普通实名制、文艺实名制和2B实名制.docx
【迷你书】C%2B%2B程序设计原理与实践(C%2B%2B之父...
典范英语2B.pdf
语言:中文 (简体) 描述:一个清理校内2B无聊评论(如"互访","求关注")的小清新插件,哼!微信号:rrsbfilter ...——防火、防盗,防2B,文艺青年居家、旅行必备!(时光飞逝,人人已经今非昔比-2018.02)
2b2t入门客户端-冰林整合2b2t入门客户端-冰林整合2b2t入门客户端-冰林整合2b2t入门客户端-冰林整合2b2t入门客户端-冰林整合2b2t入门客户端-冰林整合2b2t入门客户端-冰林整合2b2t入门客户端-冰林整合 我的世界2b2t是...
主要介绍C++ 中的单例模式写法,主要包括普通,2B,文艺三种写法,需要的朋友可以参考下
API 2B中文版.pdf
4.独立的语言包功能:国际化趋势使得行业电子商务必须面对世界市场,SmartB2B为二次开发者提供了独立的语言包功能,您更可以与世界各地的SmartB2B爱好者交流使用多语言功能。 5.广告以及广告位管理更实用、方便 6....
微风Microsoft Visual C%2B%2B 运行库合集 1.6
THB2B.rarTHB2B.rarTHB2B.rar
GaGeB2B电子商务网站源码GaGeB2B电子商务网站源码
Visual+C%2B%2B.NET案例开发集锦+源代码
1、此固件为山东联通贝尔S010W-AV2B叠加精简升级包,外壳标为S010W-AV2B型号适用,不适用于北京、四川区域版本 2、默认第三方桌面当贝桌面。 3、精简优化体验效果; 4、请勿商业用途
phpb2b开源系统 随着电子商务的日新月异,网上商城也跟着欣欣向荣。许多商家选择了phpb2b开源系统。 phpb2b开源系统是种企业对企业透过电子商务的方式进行交易的开源程序,该系统具有完善的企业、信息、产品、文章...
对BCI IV 2b竞赛数据集的预处理,包括滤波,PSD,小波变换等。
phpb2b点子商务开源门户系统
2B2B电子商务模式.pptx
ISTA -2B-2011(2012)
bugku盲水印代码。用于解杂项那题(2b)。快速秒解,谁用谁知道。