Last active
February 12, 2017 19:41
-
-
Save artivnv/d810eaadcfb241eb36ff6aad20b4b216 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
var a, b, sum, mult, resid, max int | |
fmt.Print("Введите число А:") | |
fmt.Scanln(&a) | |
fmt.Print("Введите число B отличное от числа A:") | |
fmt.Scanln(&b) | |
sum = a + b | |
mult = a * b | |
resid = a - b | |
// resid1 = b - a | |
if a == b { | |
fmt.Println("Числа не должны быть одинаковыми") | |
} else { | |
fmt.Println("Сумма чисел а и b равна:", sum) | |
fmt.Println("Произведение чисел a и b:", mult) | |
fmt.Println("Разность чисел a и b:", resid) | |
// fmt.Println("Разность чисел b и a:", resid1) | |
} | |
if sum > mult { | |
max = sum | |
} else { | |
max = mult | |
} | |
if resid > max { | |
max = resid | |
} | |
/* if sum > mult { | |
max = sum | |
} else { | |
max = mult | |
} | |
if resid > resid1 { | |
max = resid | |
} else { | |
max = resid1 | |
} | |
if mult > resid1 { | |
max = mult | |
} else { | |
max = resid1 | |
} | |
if sum > resid { | |
max = sum | |
} else { | |
max = resid | |
} */ | |
fmt.Println("Большее из полученых чисел:", max) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment