CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 06:50:47 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=9ed21389053d8727090f4c22f95474c77155fcb45873f71bf346c4a9dc104adda%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%226qXbiN9OaLcmGeJD9TupjEJ2LlcFY2z8%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cc6cd9d9d5e084-BLR
class ComplexNumber(private val re: Double, private val im: Double) { def +(o - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ComplexNumber(private val re: Double, private val im: Double) {
- def +(otherNumber: ComplexNumber) = new ComplexNumber(re + otherNumber.re, im + otherNumber.im)
- def -(otherNumber: ComplexNumber) = new ComplexNumber(re - otherNumber.re, im - otherNumber.im)
- def *(otherNumber: ComplexNumber): ComplexNumber = {
- new ComplexNumber(re * otherNumber.re - im * otherNumber.im, im * otherNumber.re + re * otherNumber.im)
- }
- def printComplex(): Unit = {
- println(s"${re} + ${im}i")
- }
- }
- object ComplexNumbersCalculator extends App {
- private def createComplexNumberFromConsole() = {
- println("Enter real part:")
- val re = scala.io.StdIn.readDouble()
- println("Enter imaginary part:")
- val im = scala.io.StdIn.readDouble()
- new ComplexNumber(re, im)
- }
- private var continue = true
- while (continue) {
- val num1: ComplexNumber = createComplexNumberFromConsole()
- val num2: ComplexNumber = createComplexNumberFromConsole()
- println("Choose operation ['+', '-', '*']:")
- val operation = scala.io.StdIn.readChar()
- if (operation == '+') {
- (num1 + num2).printComplex()
- } else if (operation == '-') {
- (num1 - num2).printComplex()
- } else if (operation == '*') {
- (num1 * num2).printComplex()
- } else {
- println("Unknown operation!")
- }
- println("You want continue? (Y/n)")
- val continueRequest = scala.io.StdIn.readChar()
- continue = if (continueRequest == 'Y') true else false
- }
- println("Bye bye!")
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐⭐⭐Exploit 500$ in 15 Minutes⭐⭐
Java | 11 sec ago | 0.10 KB
-
⭐⭐⭐ G2A Payment Exploit ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 16 sec ago | 0.24 KB
-
⭐✅ MAKE $2500 IN 15 MIN ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 26 sec ago | 0.24 KB
-
⭐ ✅ Free Products Method ✅ ✅ NEVER SEEN BEFOR...
JavaScript | 36 sec ago | 0.24 KB
-
⭐✅ Swapzone Glitch ✅ Working⭐⭐⭐ M
JavaScript | 43 sec ago | 0.24 KB
-
⭐ G2A Bug ⭐ (Get more on BTC swaps) ✅ NEVER S...
JavaScript | 45 sec ago | 0.24 KB
-
✅ Make $2500 in 20 minutes⭐⭐⭐ H
JavaScript | 54 sec ago | 0.24 KB
-
⭐✅ Jack's Profit Method ✅ NEVER SEEN BEF...
JavaScript | 54 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand