> For the complete documentation index, see [llms.txt](https://sois-organization.gitbook.io/algorithm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sois-organization.gitbook.io/algorithm/baekjoon/undefined-2/1.md).

# \[1단계] 입출력과 사칙연산

## 2557 - Hello World

```swift
print("Hello World!")
```

## 1000 A+B

```swift
let input = readLine()!.split(separator: " ").map { Int($0)! }
print("\(input[0] + input[1])")
```

## 1001 A-B

```swift
let input = readLine()!.split{ $0 == " "}.map { Int($0)! }
print(input[0] - input[1])
```

## 10998 AxB

```swift
print(readLine()!.split{ $0 == " " }.map { Int($0)! }.reduce(1, *))
```

## 1008 A/B

```swift
let input = readLine()!.split{ $0 == " " }.map { Double($0)! }
print(input[0] / input[1])
```

## 10869 사칙연산

```swift
let input = readLine()!.split{ $0 == " " }.map { Int($0)! }
let (a, b) = (input[0], input[1])
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a % b)
```

## 10926 ??!

```swift
print(readLine()! + "??!")
```

## 18108 1998년생인 내가 태국에서는 2541년생?!

```swift
print(Int(readLine()!)! - 543)
```

## 10430 나머지

```swift
let input = readLine()!.split { $0 == " " }.map { Int($0)! }, (a, b, c) = (input[0], input[1], input[2])
[(a+b)%c, (a+b)%c, (a*b)%c, (a*b)%c].forEach { print($0) }// Some code
```

## 2588 곱셈

```swift
let num1 = Int(readLine()!)!
let num2 = Int(readLine()!)!
let num2Arr = String(num2).map { Int(String($0))! }.reversed()
var result = num2Arr.map { $0 * num1 }
result.append (num1 * num2)
result.forEach { print($0) }
```

## 11382 꼬마 정민

```swift
print(readLine()!.split { $0 == " " }.map { Int($0)! }.reduce(0, +))
```

## 10171 고양이&#x20;

```swift
print(#"""
\    /\
 )  ( ')
(  /  )
 \(__)|
"""#)
```

## 10172 개

```swift
print(#"""
|\_/|
|q p|   /}
( 0 )"""\
|"^"`    |
||_/=\\__|
"""#)
```
