[C#] 11일차 - 77. n의 m승을 계산하는 메소드
C#/C#200제2021. 2. 5. 11:17[C#] 11일차 - 77. n의 m승을 계산하는 메소드

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A077_PowerMethod { class Program { static void Main(string[] args) { for (int i = 1; i

[C#] 11일차 - 76. 두 숫자 사이의 모든 정수값을 더하는 메소드
C#/C#200제2021. 2. 5. 11:05[C#] 11일차 - 76. 두 숫자 사이의 모든 정수값을 더하는 메소드

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A076_AddMethod { class Program { static void Main(string[] args) { Console.WriteLine("1부터 100까지의 합 : {0}", Add(1, 100)); Console.WriteLine("101부터 200까지의 합 : {0}", Add(101, 200)); } private static int Add(int x, int y) { int sum = 0; for(int i=x; i

[C#] 11일차 - 75. 팩토리얼을 계산하는 메소드
C#/C#200제2021. 2. 5. 11:00[C#] 11일차 - 75. 팩토리얼을 계산하는 메소드

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A075_FactorialMethod { class Program { static void Main(string[] args) { int sum = 0; for(int i=1; i

[C#] 11일차 - 74. 피라미드 메소드
C#/C#200제2021. 2. 5. 10:51[C#] 11일차 - 74. 피라미드 메소드

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A074_PyramidMethod { class Program { static void Main(string[] args) { DrawPyramid(3); DrawPyramid(5); DrawPyramid(7); } static void DrawPyramid(int num) { for(int i=1; i

[C#] 11일차 - 73. 생애계산기
C#/C#200제2021. 1. 31. 16:56[C#] 11일차 - 73. 생애계산기

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A073_AgeCalculator { class AgeCalculator { static void Main(string[] args) { Console.WriteLine("생일을 입력하세요(yyyy/mm/dd) : "); string birth = Console.ReadLine(); string[] bArr = birth.Split('/'); // '/'를 기준으로 나눠서 배열에 저장 int bYear = int.Parse(bArr[0]); int bMonth = int.Parse(..

image