336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
1. 목표 :
기본 C# 프로그래밍을 작성하여 보자.
2. 소스코드 :
Program.cs
using System;// 기본 인클루드 개념 // using System.Collections.Generic; // using System.Linq; // using System.Text; // using System.Threading.Tasks; namespace Com._001.mochi { class mochi_001 { static void Main(string[] args) { Console.WriteLine("두수를 입력하면 덧셈을 해드립니다."); // Console.WriteLine 은 자동 개행이 이뤄지는 함수이다. Console.Write( "첫 번째 : "); // Consle.Write은 자동 개행이 이뤄지는 함수가 아니다. int nFirst = int.Parse(Console.ReadLine()); // int는 자료형이며 클래스다. Console.ReadLine으로 입력받은 값을 int.Parse로 // 읽어들인 string 을 integer 로 변환하고 그값을 nFirst에 복사한다. Console.Write( "두 번째 : "); int nSecond = int.Parse(Console.ReadLine()); Console.WriteLine("{0} + {1} = {2}",nFirst, nSecond, (nFirst + nSecond)); // Console.WriteLine의 기능으로 {}중괄호 안에 내용의 순서를 정할수 있다. // 예를들어 Console.WriteLine("{2} = {1} + {0}", nFirst, nSecond, (nFirst + nSecond)); // 라고 할 경우 3 = 2 + 1과 같은 결과를 얻을 수 있다. Console.WriteLine("{2} = {1} + {0}", nFirst, nSecond, (nFirst + nSecond)); } } }
3. 결과
먹고 살려면 해야지 cpp로 먹고 살긴 힘들듯하당...
정말 개발자로 먹고 살려면 한가지 언어로는 진심 힘들다.