[C#] 7일차 - 47. x의 y승 구하기
C#/C#200제2021. 1. 23. 09:35[C#] 7일차 - 47. x의 y승 구하기

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A047_Power { class Program { static void Main(string[] args) { Console.WriteLine("x의 y승을 계산합니다."); Console.Write("x 를 입력하세요 : "); int x = int.Parse(Console.ReadLine()); Console.Write("y 를 입력하세요 : "); int y = int.Parse(Console.ReadLine()); int pow = 1; for (int i = 0; i < ..

[C#] 7일차 - 46. 평균, 최소, 최대값 구하기
C#/C#200제2021. 1. 22. 14:05[C#] 7일차 - 46. 평균, 최소, 최대값 구하기

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A046_MinMax { class Program { static void Main(string[] args) { double max = double.MinValue; double min = double.MaxValue; double sum = 0; for(int i =0; i max) max = h; if (h < min) min = h; sum += h; } Console.WriteLine("평균: {0}cm, 최대:{1}cm, 최소:{2}cm", sum / 5, max, min..

[C#] 7일차 - 45. 반복문으로 구구단 출력
C#/C#200제2021. 1. 22. 13:26[C#] 7일차 - 45. 반복문으로 구구단 출력

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A045_MultiplicationTable { class Program { static void Main(string[] args) { Console.Write("구구단의 출력할 단수를 입력하세요 :"); int n = int.Parse(Console.ReadLine()); for(int i=1; i

[C#] 7일차 - 44. 반복문으로 2진, 8진, 16진 출력
C#/C#200제2021. 1. 22. 13:21[C#] 7일차 - 44. 반복문으로 2진, 8진, 16진 출력

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A044_NumberSystem { class Program { static void Main(string[] args) { Console.WriteLine("{0,5} {1,8} {2,3} {3,4}", "10진수", "2진수", "8진수", "16진수"); for(int i=0; i

[C#] 7일차 - 43. 반복문(1에서100까지 더하기, 홀수의합, 역수의합)
C#/C#200제2021. 1. 22. 13:16[C#] 7일차 - 43. 반복문(1에서100까지 더하기, 홀수의합, 역수의합)

"Hello World"라는 문장을 10번 출력하는 프로그램을 3가지 방법으로 작성 while int i = 0; // 초기값 while(i < 10) //반복하는 조건 { Console.WriteLine("{0} : Hello world",i); i++; //반복할 때마다 변하는 값 } do while int i = 0; // 초기값 do { Console.WriteLine("{0} : Hello World", i); i++; // 반복할 때마다 변하는 값 } while (i < 10); // 반복하는 조건 for for(int i=0; i

image