0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

代入と出力

Last updated at Posted at 2015-10-30

Playgroundで打ち込んでみよう!

例題:hello world

print("Hello World!")

例題:変数への代入と出力

var a = 1
print(a)

a = 3
print(a)

例題:四則演算

var a = 4
var b = 2

//加算
print(a + b)

//減算
print(a - b)

//乗算
print(a * b)

//除算
print(a / b)

//余り
a = 5
print(a % b)

例題:比較演算

var a = 4
var b = 2

//より小さい
print(a < b)

//以下
print(a <= b)

//より大きい
print(a > b)

//以上
print(a >= b)

//等しい
print(a == b)

//等しくない
print(a != b)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?