백준 알고리즘(8)
-
백준 2588번 곱셈(JAVA, C#)
C# using System; namespace Baekjoon { class Program { static void Main() { string s = Console.ReadLine(); string s2 = Console.ReadLine(); char[] s3 = s2.ToCharArray(); int num = int.Parse(s); int[] num2 = new int[s2.Length]; for(int i = 0;i
2023.04.01 -
백준 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 -
백준 C#, JAVA 10926번 아이디 string 뒤에 ??! 붙이기
C# using System; namespace Baekjoon { class Program { static void Main(string[] args) { string s = Console.ReadLine(); Console.WriteLine(s + "??!"); } } } ////// 자바 import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); String a = sc.next(); System.out.println(a + "??!"); } }
2023.03.10 -
백준 JAVA, C# 10089번 사칙연산, 나머지 구하기
import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int a, b; a = sc.nextInt(); b = sc.nextInt(); System.out.println(a + b); System.out.println(a - b); System.out.println(a * b); System.out.println(a / b); System.out.println(a % b); } } ///////////// using System; namespace Baekjoon { class Program { static void Main() { string s = ..
2023.03.09