백준알고리즘(3)
-
백준 10430번 나머지(JAVA, C#)
C# using System; namespace Baekjoon { class Program { static void Main() { string s = Console.ReadLine(); string[] ss = s.Split(); int a = int.Parse(ss[0]); int b = int.Parse(ss[1]); int c = int.Parse(ss[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); } } } ////////////////// JAVA import java.util.*; public clas..
2023.03.29 -
백준 3003번 JAVA, C# (킹, 퀸, 룩, 비숍, 나이트, 폰)
C# using System; namespace Baekjoon { class Program { static void Main() { string s = Console.ReadLine(); string[] ss = s.Split(); int a = int.Parse(ss[0]); int b = int.Parse(ss[1]); int c = int.Parse(ss[2]); int d = int.Parse(ss[3]); int e = int.Parse(ss[4]); int f = int.Parse(ss[5]); Console.WriteLine(1-a); Console.WriteLine(1-b); Console.WriteLine(2-c); Console.WriteLine(2-d); Console.WriteLi..
2023.03.27 -
백준 18108번 1998년생인 내가 태국에서는 2541년생?! C#(JAVA)
자바 using System; namespace Baekjoon { class Program { static void Main(string[] args) { int a = int.Parse(Console.ReadLine()); Console.WriteLine(a-543); } } } ////////////// C# import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); System.out.println(a - 543); } }
2023.03.10