[ create a new paste ] login | about

kinyou

Name: Sdeepwang
Email:
Site/Blog: http://www.weibo.com/xingyuanwang/
Location: china
Default language: C
Favorite languages: C&PHP&SHELL&Ruby
About: l love the Ruby language!

Saved pastes by kinyou:

PHP, pasted on Dec 23:
1
2
3
4
5
<?php

$str = "U-CAR,";
$trans = array("-"=>"-",","=>"、");
echo strtr($str,$trans);
view (5 lines, 1 line of output)
PHP, pasted on Dec 23:
1
2
3
4
5
<?php

$str = "U-CAR,";
$trans = array("-"=>"ー",","=>"、");
echo strtr($str,$trans);
view (5 lines, 1 line of output)
C, pasted on Dec 4:
1
2
3
4
5
#include<stdio.h>

int main(void){

    int arr[10]={1,2,3,4,5,6,7,8,9,10};
...
view (24 lines, 32 lines of output)
PHP, pasted on Nov 26:
1
2
3
4
5
<?php
$arr = array('毛色:::黑,,,白,,,水粉','尺寸:::L,,,M,,,S');
$arr2 = array('毛色:::黑,,,白,,,水粉','尺寸:::L,,,M,,,S');
print_r($arr);
foreach($arr as $key=>$value){
...
view (17 lines, 55 lines of output)
C, pasted on Nov 9:
1
2
3
4
5
#include<stdio.h>
int main(void){
    int arr[] = {3,45,23,56,12};
    int i;
    for(i=0;i<5;i++){
...
view (10 lines, 5 lines of output)
C, pasted on Nov 8:
1
2
3
4
5
#include<stdio.h>

int main(void){
    const int NUMBER = 22;
    int count;
...
view (12 lines, 22 lines of output)
C, pasted on Nov 8:
1
2
3
4
5
#include<stdio.h>

int main(void){
    const int NUMBER = 22;
    int count = 1;
...
view (13 lines, 22 lines of output)
C, pasted on Oct 28:
1
2
3
4
5
#include<stdio.h>

int main(void){
    char ch = 'a';
    
...
view (11 lines, 7 lines of output)
C, pasted on Oct 27:
1
2
3
4
5
#include<stdio.h>
#define TEN 10
int main(void){
    int n = 0;
    while(n++ < TEN){
...
view (10 lines, 1 line of output)
C, pasted on Oct 27:
1
2
3
4
5
#include<stdio.h>
int main(void){
    char c1,c2;
    int diff;
    float num;
...
view (13 lines, 1 line of output)
C, pasted on Oct 27:
1
2
3
4
5
#include<stdio.h>
#define FORMAT "%s! C is cool!\n"
int main(void){
    int num=10;
    printf(FORMAT,FORMAT);
...
view (10 lines, 5 lines of output)
C, pasted on Oct 26:
1
2
3
4
5
#include<stdio.h>
int main(void){
    char ch;
    int i;
    float fl;
...
view (19 lines, 3 lines of output)
C, pasted on Oct 26:
1
2
3
4
5
#include<stdio.h>
int main(void){
    int res;
    int tmp=3,tmp2=2,tmp3;
    res = tmp+(tmp3=tmp2*tmp);
...
view (8 lines, 1 line of output)
C, pasted on Oct 26:
1
2
3
4
5
#include<stdio.h>
int main(void){
int num,square;
num = 2;
while(num < 7){
...
view (10 lines, 5 lines of output)
C, pasted on Oct 26:
1
2
3
4
5
#include <stdio.h>
int main(void){
    int n = 222222;
    size_t intsize;
    intsize = sizeof(int);
...
view (8 lines, 1 line of output)
C, pasted on Oct 26:
1
2
3
4
5
/* 除号的使用 */
#include <stdio.h>
int main(void){

    printf("5/4 is %d \n",5/4);
...
view (12 lines, 5 lines of output)
C, pasted on Oct 26:
1
2
3
4
5
#include<stdio.h>
int main(void){
    int num = 1;
    
    while(num < 20){
...
view (11 lines, 19 lines of output)
C, pasted on Oct 18:
1
2
3
4
5
#include <stdio.h>
#define PAGES 931

int main(void){
    printf("*1234567890*\n");
...
view (11 lines, 5 lines of output)
C, pasted on Oct 18:
1
2
3
4
5
#include <stdio.h>
#include <limits.h> //整数的限制
#include <float.h> //浮点数的限制

int main(void){
...
view (16 lines, 9 lines of output)
C, pasted on Oct 18:
1
2
3
4
5
#include <stdio.h>
#include <limits.h> //整数的限制
#include <float.h> //浮点数的限制

int main(void){
...
view (15 lines, 8 lines of output)
Ruby, pasted on Sep 9:
1
2
3
4
5
line = '210.128.158.121 - oadev [09/Sep/2014:12:01:20 +0900] "GET /images/home_image/img/15457/large.jpg HTTP/1.0" 200 0 179'
(@ip, @test, @test2, @time, @timelag, @method, @file) = line.split(nil)
MONTH = {'Jan'=>'1','Feb'=>'2','Mar'=>'3','Apr'=>'4','May'=>'5','Jun'=>'6','Jul'=>'7','Aug'=>'8','Sep'=>'9','Oct'=>10,'Nov'=>'11','Dec'=>'12'};
puts @file
        year    = @time[8,4]
...
view (13 lines, 5 lines of output)
Ruby, pasted on Sep 9:
1
2
3
4
5
line='36.46.178.254 - oadev [09/Sep/2014:13:57:09 +0900] "GET /categ=0/login_id=110416/plan/ HTTP/1.1" 200 0 11363'
(@ip, @test, @test2, @time, @timelag, @method, @file) = line.split(nil)
puts @ip
puts @test
puts @test2
...
view (13 lines, 9 lines of output)
PHP, pasted on Sep 2:
1
2
3
4
5
<?php
$arr = array(
    array("NAME"=>"order_mail_text","VAL"=>"sss"),
    array("NAME"=>"order_mail_text","VAL"=>"ggg"),
    array("NAME"=>"inquiry_mail_text","VAL"=>"df"),
...
view (26 lines, 6 lines of output)
Ruby, pasted on Aug 30:
1
2
3
4
5
#ruby 的类方法

class SongList
    MAX_TIME = 5*60
    
...
view (31 lines, 2 lines of output)
Ruby, pasted on Aug 30:
1
2
3
4
5
#ruby的类变量和php的static形容的属性一样

#ruby的类变量是类的所有实例对象所共享的,所以初始化必须赋值

class Song
...
view (27 lines, 5 lines of output)
Ruby, pasted on Aug 30:
1
2
3
4
5
#ruby的可写属性便捷方法

class Song

    attr_reader :duration
...
view (18 lines, 2 lines of output)
Ruby, pasted on Aug 30:
1
2
3
4
5
#ruby的可写属性

class Song

     attr_reader :duration
...
view (21 lines, 2 lines of output)
Ruby, pasted on Aug 30:
1
2
3
4
5
#ruby的属性的便捷方法attr_reader

class Song

    attr_reader :name,:artist,:duration
...
view (19 lines, 3 lines of output)
Ruby, pasted on Aug 30:
1
2
3
4
5
#ruby对象的属性

class Song
    
    #相当于php的__get魔术方法
...
view (29 lines, 3 lines of output)
Ruby, pasted on Aug 30:
1
2
3
4
5
#ruby的构造方法的使用initialize

class Song
    def initialize(name,artist,duration)
        @name = name
...
view (31 lines, 1 line of output)
Ruby, pasted on Aug 28:
1
2
3
4
5
#ruby的构造方法的使用initialize

class Song
    def initialize(name,artist,duration)
        @name = name
...
view (18 lines, 2 lines of output)
Ruby, pasted on Aug 28:
1
2
3
4
5
#ruby的构造方法的使用initialize

class Song
    def initialize(name,artist,duration)
        @name = name
...
view (13 lines, 1 line of output)
Ruby, pasted on Aug 27:
1
2
3
4
5
#几个常用的迭代器

3.times {puts "* "}

%w(cat,dog,elk).each {|animals| puts animals}
...
view (11 lines, 19 lines of output)
Ruby, pasted on Aug 27:
1
2
3
4
5
#给Block提供参数的方法
#Block块中的参数用两个|包括起来,如果有多个参数,它们之间用逗号分隔

def call_block
    yield("hello","sdeepwang")
...
view (8 lines, 1 line of output)
Ruby, pasted on Aug 27:
1
2
3
4
5
#ruby的Block和迭代器

def call_block
    puts "Start of method"
    yield
...
view (10 lines, 4 lines of output)
Ruby, pasted on Aug 26:
1
#ruby的Block和迭代器
view (1 line)
Ruby, pasted on Aug 26:
1
2
3
4
#ruby的正则
# 字符串 =~ 正则对象 操作符表示用正则表达来匹配左边的字符串,如果匹配返回匹配的位置,否则返回nil

line = 'my first language is php script'
...
view (12 lines, 1 line of output)
Ruby, pasted on Aug 26:
1
2
3
4
5
#ruby的while语句

var = 10

#while的常规写法
...
view (17 lines, 11 lines of output)
Ruby, pasted on Aug 26:
1
2
3
4
5
#ruby的流程控制语句

var = 37

#这是惯例写法
...
view (14 lines, 2 lines of output)
Ruby, pasted on Aug 26:
1
2
3
4
5
#ruby的散列用法与数组相似但是定义不同于数组而是用花括号{}
list = {'name'=>'sdeepwang',1=>'demo','age'=>25}


#=>的左边是键,右边是其对应的值,在一个散列中键必须唯一,键和值可以是任意对象
...
view (7 lines, 2 lines of output)
Ruby, pasted on Aug 26:
1
2
3
4
5
#ruby的数组是由方括号括起来的如下

arr = ['ant','bee','cat','dog','elk']

puts arr[3]
...
view (17 lines, 3 lines of output)
Ruby, pasted on Aug 26:
1
2
3
4
#任意复杂的表达都容许放到{}之中
def say_goodbey(name)
    result = "Good bey #{name.capitalize}"
end
...
view (6 lines, 1 line of output)
Ruby, pasted on Aug 26:
1
2
3
4
5
#这是ruby的一个简单函数定义,用#表示注释

def say_goodbey(name)
    result = "Good night #{name}"
end
...
view (8 lines, 2 lines of output)
Ruby, pasted on Aug 26:
1
2
3
name = "あいうえお那就这样吧"
len = name.length
puts len
view (3 lines, 1 line of output)
PHP, pasted on Aug 15:
1
2
3
4
5
<?php

$month1_time   = getDateAfterMonth('2014-08-15 14:34:18.808474+09',1);
echo $month1_time;
echo "\n";
...
view (17 lines, 2 lines of output)
PHP, pasted on Aug 13:
1
2
3
4
5
<?php /*为什么do while没有替换语法*/?>
<?php $i = 10 ;?>
<?php do:?>
<?php echo $i;$i--;?>
<?php enddo;?>
...
view (6 lines, 2 lines of output)
PHP, pasted on Aug 13:
1
2
3
4
5
<?php $i = 5;?>
<?php switch($i):?>
<?php case 1: echo "i am 1";break;?>
<?php case 2: echo "i am 2";break;?>
<?php case 3: echo "i am 3";break;?>
...
view (7 lines, 1 line of output)
PHP, pasted on Aug 13:
1
2
3
4
<?php $arr = range(0,10);?>
<?php foreach($arr as $key=>$value):?>
<?php echo $key."<----->".$value."\n";?>
<?php endforeach;?>
view (4 lines, 11 lines of output)
PHP, pasted on Aug 13:
1
2
3
4
<?php $i= 0;?>
<?php while($i < 10):?>
<?php echo $i."\n";$i++;?>
<?php endwhile;?>
view (4 lines, 10 lines of output)
PHP, pasted on Aug 13:
1
2
3
4
5
<?php for($i = 0 ;$i < 10 ;$i++):?>
<?php if($i > 3):?>
<?php echo $i."\n";?>
<?php endif;?>
<?php endfor;?>
view (5 lines, 6 lines of output)
PHP, pasted on Aug 13:
1
2
3
<?php for($i = 0 ;$i < 10 ;$i++):?>
<?php echo $i."\n";?>
<?php endfor;?>
view (3 lines, 10 lines of output)
PHP, pasted on Aug 13:
1
2
3
4
5
<?php
/*php的替代语法*/

$a = 7;
if($a==5):
...
view (15 lines, 1 line of output)
PHP, pasted on Aug 13:
1
2
3
4
5
<?php

/*反射类的应用说明*/

class MyClass {
...
view (19 lines, 2 lines of output)
C, pasted on Aug 5:
1
2
3
4
5
/*指针的8种基本操作*/

#include <stdio.h>

int main(void){
...
view (21 lines, 7 lines of output)
C, pasted on Aug 3:
1
2
3
4
5
/*指针的8种基本操作*/

#include <stdio.h>

int main(void){
...
view (16 lines, 2 lines of output)
C, pasted on Jul 27:
1
2
3
4
/*指针作为参数*/
#include <stdio.h>

#define SIZE 10
...
view (24 lines, 1 line of output)
C, pasted on Jul 26:
1
2
3
4
5
/*指针与数组*/

#include <stdio.h>

#define MONTHS 12
...
view (16 lines, 12 lines of output)
C, pasted on Jul 26:
1
2
3
4
/*数组的内存地址*/
#include <stdio.h>

#define SIZE 4
...
view (23 lines, 5 lines of output)
C, pasted on Jul 26:
1
2
3
4
5
#include <stdio.h>

#define SIZE 4

int main(void){
...
view (22 lines, 5 lines of output)
C, pasted on Jul 26:
1
2
3
4
5
/*指针与数组学习*/
#include <stdio.h>

int main(void){
    int arr[3]={1,2,3};
...
view (12 lines, 2 lines of output)
C, pasted on Jul 21:
1
2
3
4
5
/*如果一个数组只允许读,而不允许写的时候定义的时候用const关键字*/
#include <stdio.h>
#define MONTHS 12

int main(void){
...
view (13 lines, 12 lines of output)
C, pasted on Jul 21:
1
2
3
4
/*定义数组的时候建议使用宏定义数组长度这样方便将来修改*/
#include <stdio.h>

#define MONTHS 12
...
view (14 lines, 12 lines of output)
C, pasted on Jul 21:
1
2
3
4
5
#include <stdio.h>

#define MONTHS 12

int main(void){
...
view (13 lines, 12 lines of output)
C, pasted on Jul 20:
1
2
3
4
/*递归函数的使用*/
#include <stdio.h>

void up_and_down(int n);
...
view (19 lines, 8 lines of output)
C, pasted on Jul 20:
1
2
3
4
/*递归函数的使用*/
#include <stdio.h>

void up_and_down(int n);
...
view (19 lines, 8 lines of output)
C, pasted on Jul 20:
1
2
3
4
5
#include <stdio.h>

int imax();

int main(void){
...
view (15 lines, 2 lines of output)
C, pasted on Jul 20:
1
2
3
4
#include <stdio.h>
int demo(void);

int main(void){
...
view (17 lines, 1 line of output)
C, pasted on Jul 19:
1
2
3
4
5
#include <stdio.h>
#include <string.h>
#define NAME "GIGATHINK, INC. "
#define ADDRESS "101 Megabuck Plaza"
#define PLACE "Megapolis,CA 94904"
...
view (32 lines, 5 lines of output)
C, pasted on Jul 19:
1
2
3
4
5
#include <stdio.h>
#include <string.h>
#define NAME "GIGATHINK, INC. "
#define ADDRESS "101 Megabuck Plaza"
#define PLACE "Megapolis,CA 94904"
...
view (27 lines, 3 lines of output)
C, pasted on Jul 18:
1
2
3
4
5
#include <stdio.h>

#define NAME "XINGYUAN WANG"
#define ADDRESS "SHANXI XIAN"
#define JOB "PHPER"
...
view (26 lines, 5 lines of output)
C, pasted on Jul 17:
1
2
3
4
5
#include <stdio.h>
/*用return 可以修改一个值*/
int change(int u,int v);

int main(void){
...
view (21 lines, 2 lines of output)
C, pasted on Jul 17:
1
2
3
4
5
#include <stdio.h>

void interchange(int u, int v);

int main(void){
...
view (22 lines, 2 lines of output)
C, pasted on Jun 3:
1
2
3
4
5
//c语言的每一个表达式都有一个值
#include <stdio.h>

int main(void){
    int sum,a,b;
...
view (12 lines, 1 line of output)
C, pasted on Jun 3:
1
2
3
4
5
//大家知道的++和--
/*如果一个变量出现在一个函数的多个参数中,不要将++或者--放在参数上面
当一个变量多次出现在一个表达式里面,不要将++或者--放在变量上面如果
y=n++ + n++
*/
...
view (15 lines, 15 lines of output)
C, pasted on Jun 3:
1
2
3
4
5
//大家知道的++和--
#include <stdio.h>

int main(void){
    int num = 5;
...
view (11 lines, 15 lines of output)
C, pasted on Jun 1:
1
2
3
4
5
//增量的前缀和后缀

#include <stdio.h>

int main(void){
...
view (15 lines, 5 lines of output)
C, pasted on Jun 1:
1
2
3
4
5
//取余运算符的使用如果第一个数是整数结果就是整数如果是负数结果就是负数

#include <stdio.h>

int main(void){
...
view (16 lines, 2 lines of output)
C, pasted on Jun 1:
1
2
3
4
5
//使用sizeof运算符

#include  <stdio.h>
int main(void){
    int n=0;
...
view (11 lines, 1 line of output)
C, pasted on Jun 1:
1
2
3
4
5
//优先级规则的试验
#include <stdio.h>
int main(void){
    int top,score;
    
...
view (9 lines, 1 line of output)
C, pasted on Jun 1:
1
2
3
4
5
//我知道的除法
#include <stdio.h>
int main(void){
    printf("5/4 is %d\n",5/4);
    printf("6/3 is %d\n",6/3);
...
view (11 lines, 6 lines of output)
C, pasted on Jun 1:
1
2
3
4
5
//指数增长

#include <stdio.h>

#define SQUARES 64
...
view (30 lines, 67 lines of output)
C, pasted on Jun 1:
1
2
3
4
5
//C语言的乘法的使用
#include <stdio.h>

int main(void){
    int num=1;
...
view (12 lines, 20 lines of output)
C, pasted on Jun 1:
1
2
3
4
5
//C语言连续赋值方法
#include <stdio.h>

int main(void){
    int jane,tarzan,cheeta;
...
view (14 lines, 2 lines of output)
C, pasted on Jun 1:
1
2
3
4
//循环的简介
#include <stdio.h>
#define ADJUST 7.64
#define SCALE 0.325
...
view (20 lines, 17 lines of output)
C, pasted on May 26:
1
2
3
4
5
//printf函数的格式控制说明
#include <stdio.h>
#define PI 3.141593
int main(void){
    int number=5;
...
view (14 lines, 4 lines of output)
C, pasted on May 23:
1
2
3
4
5
//打印各种数据类型在系统上的占的长度

#include <stdio.h>

int main(void){
...
view (15 lines, 7 lines of output)
C, pasted on May 23:
1
2
3
4
5
//浮点数的舍入误差

#include <stdio.h>

int main(void){
...
view (14 lines, 1 line of output)
C, pasted on May 23:
1
2
3
4
5
//显示打印浮点数值

#include <stdio.h>

int main(void){
...
view (14 lines, 3 lines of output)
C, pasted on May 23:
1
2
3
4
5
//c99新引入的_Bool类型
#include <stdio.h>

int main(void){
    _Bool boolearn;
...
view (15 lines, 1 line of output)
C, pasted on May 23:
1
2
3
4
5
//打印一个字符的占位符%c
#include <stdio.h>

int main(void){
    char ch;
...
view (12 lines, 1 line of output)
C, pasted on May 23:
1
2
3
4
5
//打印unsigned,long,long long 类型的数,格式说明中的l只能用小写

#include <stdio.h>

int main(void){
...
view (16 lines, 4 lines of output)
C, pasted on May 23:
1
2
3
4
5
//整数过大的溢出现象
#include <stdio.h>

int main(void){
    int i=2147483647;
...
view (11 lines, 2 lines of output)
C, pasted on May 23:
1
2
3
4
5
//八进制十六进制和十进制分别输出100,要以8,16,2进制表示前面要加#号
/*十进制转换为2,8,16进制的时候分别除以2,8,16然后余数从低到高排列即可*/
#include <stdio.h>

int main(void){
...
view (14 lines, 2 lines of output)
C, pasted on May 23:
1
2
3
4
5
//printf函数的使用
#include <stdio.h>

int main(void){
    int ten = 10;
...
view (14 lines, 2 lines of output)
C, pasted on May 23:
1
2
3
4
5
//验证int和float的初始值
#include <stdio.h>
int main(void){
    int num;
    float a;
...
view (12 lines, 2 lines of output)
C, pasted on May 22:
1
2
3
4
5
//函数调用函数的使用范例
#include <stdio.h>

void one_three(void);/*会调用one和two函数*/
void two(void);/*输出two*/
...
view (28 lines, 5 lines of output)
C, pasted on May 22:
1
2
3
4
//函数和换行符的使用
#include <stdio.h>

void smile(void);/*定义输出smile*/
...
view (20 lines, 3 lines of output)
C, pasted on May 22:
1
2
3
4
//定义一个整数计算2倍和立方和最后输出他们三个
#include <stdio.h>
int main(void){
    int num,sum,pow;
...
view (12 lines, 1 line of output)
C, pasted on May 22:
1
2
3
4
5
//用户自定义两个函数输出东西
#include <stdio.h>

void say(void);/*夸奖的话*/
void bey(void);/*结束语*/
...
view (21 lines, 4 lines of output)
C, pasted on May 22:
1
2
3
4
5
//编写一个程序把自己的年龄转换为天并打印出他们
#include <stdio.h>
int main(void){
    int age,days;
    
...
view (11 lines, 1 line of output)
C, pasted on May 22:
1
2
3
4
5
//编写一个程序输出你的姓名和地址
#include <stdio.h>
int main(void){
    printf("sdeep wang\n");
    printf("陕西西安高新区\n");
...
view (7 lines, 2 lines of output)
C, pasted on May 22:
1
2
3
4
5
//c语言课后习题练习printf 和\n换行的练习
#include <stdio.h>

int main(void){
    printf("wang xingyuan\n");
...
view (10 lines, 4 lines of output)
C, pasted on May 22:
1
2
3
4
5
#include <stdio.h>

int main(void){
    int a,b;
    a= 5;
...
view (13 lines, 3 lines of output)
C, pasted on May 22:
1
2
3
4
//在一个文件中使用多个c函数
#include<stdio.h>

void butler(void); /*函数原型放在前面*/
...
view (17 lines, 3 lines of output)
C, pasted on May 22:
1
2
3
4
5
#include <stdio.h>
int main(void){
    int feet,fathoms;

    fathoms = 2;
...
view (12 lines, 2 lines of output, 1 comment)
Ruby, pasted on May 20:
1
2
3
4
5
lines='242080  三重県  名張市    242161  三重県  伊賀市
244724  三重県  南伊勢町    242039  三重県  伊勢市
244724  三重県  南伊勢町    244708  三重県  度会町
244724  三重県  南伊勢町    244716  三重県  大紀町
244724  三重県  南伊勢町    242152  三重県  志摩市
...
view (17 lines, 6 lines of output)
Ruby, pasted on Apr 25:
1
2
3
lineStr = '36.45.163.126 - oadev [25/Apr/2014:18:23:29 +0900] "GET /categ=0/login_id=140434/blog/ HTTP/1.1" 200 0 66242'

(@ip, @test, @test2, @time, @timelag, @method, @file) = lineStr.split(nil)
...
view (12 lines, 3 lines of output)
Ruby, pasted on Apr 13:
1
2
3
4
5
def repeat(num)
    while num > 0
        yield
        num -= 1
    end
...
view (18 lines, 7 lines of output)
Ruby, pasted on Apr 13:
1
2
3
4
5
def repeat(num)
    while num > 0
        yield
        num -= 1
    end
...
view (18 lines, 7 lines of output)
Ruby, pasted on Apr 13:
1
2
3
4
5
#单行循环块
#重复三次
3.times{puts "I love Ruby\n"}
puts "-------------------------"
#从1到9的循环
...
view (17 lines, 13 lines of output)
Ruby, pasted on Apr 13:
1
2
3
4
class Man
    def initialize(name,age)
        @name = name
        @age  = age
...
view (42 lines, 5 lines of output)
Ruby, pasted on Apr 12:
1
2
3
4
5
class Person
    #用这行代码替换上面的那9行代码
    attr_reader :name, :age, :motherland
    #用这行代码替换类变量的设置值
    attr_writer :name, :age, :motherland
...
view (28 lines, 4 lines of output)
Ruby, pasted on Apr 12:
1
2
3
4
5
class Person
    def name
        @name
    end
    
...
view (39 lines, 4 lines of output)
Ruby, pasted on Apr 9:
1
2
3
4
5
class MegaGreeter
  attr_accessor :names

  # Create the object
  def initialize(names = "World")
...
view (58 lines, 12 lines of output)
Ruby, pasted on Apr 9:
1
2
3
4
class Hello
    def initialize(name="Sdeep wang")
        @name = name;
    end
...
view (19 lines, 2 lines of output)
C, pasted on Apr 3:
1
2
3
4
5
#include <stdio.h>
int main(){
     int lower,upper;
     int step,result;
     lower = 0;
...
view (15 lines, 16 lines of output)
C, pasted on Apr 3:
1
2
3
4
5
#include <stdio.h>
int main(){
     int a =6;
     printf("123456789\n");
     printf("s%6d\n",a);
...
view (8 lines, 2 lines of output)