Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
// Projekt6.1.1
package main
import "fmt"
func NWD(a, b int) int {
for a != b {
if a > b {
a = a - b
} else {
b = b - a
return a
func main() {
var a, b int
fmt.Println("Wpisz A: ")
fmt.Scanf("%d", &a)
fmt.Println("Wpisz B: ")
fmt.Scanf("%d", &b)
w := NWD(a, b)
fmt.Printf("Największy wspólny mianownik liczb %d i %d to %d\n", a, b, w)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment