C# 10430 분배법칙
Algorithmus 2021. 10. 25. 10:19https://www.acmicpc.net/problem/10430
using System;
using System.Threading;
using System.Collections.Generic;
namespace NetHappy
{
class Program
{
static void Main(string[] args)
{
string str;
str = Console.ReadLine();
string[] result = str.Split(new char[] { ' ' });
double a = (double)Convert.ToInt32(result[0]);
double b = (double)Convert.ToInt32(result[1]);
double c = (double)Convert.ToInt32(result[2]);
Console.WriteLine((a + b) % c);
Console.WriteLine(((a % c) + (b % c)) % c);
Console.WriteLine((a * b) % c);
Console.WriteLine(((a % c) * (b % c)) % c);
}
}
}
'Algorithmus' 카테고리의 다른 글
20200811 임시, 추가 변수없이 두 정수값 교체 (0) | 2020.08.11 |
---|---|
[설탕 배달]06-12 (0) | 2019.06.12 |
AStar algorithm 4방향(캐릭터 이동) (0) | 2019.05.21 |
AStar algorithm (0) | 2019.05.20 |
[Palindrome Number]05-14 (0) | 2019.05.14 |