[Golang] [백준/10430] 나머지

wookii·2021년 1월 18일
0

CP with Golang

목록 보기
6/8

[백준/10430] 나머지

https://www.acmicpc.net/problem/10430

package main

import (
	"bufio"
	"fmt"
	"os"
)

var (
	w = bufio.NewWriter(os.Stdout)
	r = bufio.NewReader(os.Stdin)
)

func main() {
	defer w.Flush()
	var a, b, c int
	fmt.Fscanln(r, &a, &b, &c)
	fmt.Fprintf(w, "%d\n%d\n%d\n%d", (a+b)%c, (a%c+b%c)%c, (a*b)%c, (a%c)*(b%c)%c)
}
profile
Love Kubernetes | Python & Go

0개의 댓글