1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ee { class MainApp { static double Square(double arg) { return arg * arg; } static void Main(string[] args) { Console.WriteLine("수를 입력하세요. :"); string input = Console.ReadLine(); double arg = Convert.ToDouble(input); Console.WriteLine("결과:{0}",Square(arg)); } } } | cs |
'C#' 카테고리의 다른 글
뇌를 자극하는 C# 5.0 프로그래밍 연습문제 6장 3번 (0) | 2022.07.26 |
---|---|
뇌를 자극하는 C# 5.0 프로그래밍 연습문제 6장 2번 (0) | 2022.07.26 |
return문 재귀 호출 피보나치 수 (0) | 2022.07.26 |
메소드 int 형식 매개 변수를 입력받고, 이 매개 변수의 결과 값 출력 (0) | 2022.07.26 |
foreach를 사용할 수 있는 일반화 클래스 (0) | 2022.07.25 |