我用irb.
我写下面的代码.
"ax".."bc"
我预计
"ax""ay""az""ba"bb""bc"
但结果是公正的
"ax".."bc"
我该怎么说?谢谢.
我开始使用IRB学习Ruby并在下面写错了代码:
irb(main):001:0>"amefurashi".delete(aiueo")
Run Code Online (Sandbox Code Playgroud)
我注意到它缺少双引号,并且提示符改为:
irb(main):002:1"
Run Code Online (Sandbox Code Playgroud)
我写了正确的代码:
irb(main):001:1"amefurashi".delete("aiueo")
Run Code Online (Sandbox Code Playgroud)
但为什么它不起作用?
我使用自制软件,将此命令写入terminal.app以安装postgresql.
`brew install postgresql`
<pre>==> Installing postgresql dependency: ossp-uuid
==> Downloading ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
curl: (7) couldn't connect to host
Trying a mirror...
==> Downloading http://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
######################################################################## 100.0%
==> ./configure --disable-debug --without-perl --without-php --without-pgsql --prefix=/usr/local/Cell
==> make
==> make install
/usr/local/Cellar/ossp-uuid/1.6.2: 12 files, 332K, built in 62 seconds
==> Installing postgresql
==> Downloading http://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v9.1.1/postgresql-9.1.1.t
######################################################################## 100.0%
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.1 --enable-thread-safety --
==> make install-world
==> Caveats
# Build Notes
If builds of PostgreSQL 9 are failing and you have version 8.x …Run Code Online (Sandbox Code Playgroud) 我认为这段代码的结果= 4950.那是因为99 + 98 + ... 1 = 4950.你能告诉我怎么样吗?
public static void main(String[] args) {
int n = 100;
int total = 0;
while(n >= 0){
total += --n;
}
System.out.println(total);
}
Run Code Online (Sandbox Code Playgroud)