분류 전체보기79 뇌를 자극하는 C# 5.0 프로그래밍 연습문제 6장 2번 2022. 7. 26. 뇌를 자극하는 C# 5.0 프로그래밍 연습문제 6장 1번 12345678910111213141516171819202122232425using 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)); } }}Col.. 2022. 7. 26. return문 재귀 호출 피보나치 수 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 26 27 28 29 30 31 32 33 34 using System; namespace ee { class MainApp { static int Fibonacci(int n) { if (n 2022. 7. 26. 메소드 int 형식 매개 변수를 입력받고, 이 매개 변수의 결과 값 출력 12345678910111213141516171819202122232425262728293031using System; namespace ee{ class Calculator { public static int Plus(int a, int b) { return a + b; } public static int Minus(int a, int b) { return a - b; } } class MainApp { public static void Main() { int result = Calculator.Plus(3, 4); Console.WriteLine(result); result = Calculator.Minus(5, 2); Console.WriteLine(result); } } }Colored by Co.. 2022. 7. 26. 이전 1 2 3 4 5 6 ··· 20 다음