일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- React Native
- 티스토리초대
- 티스토리 초대장/ 티스토리초대
- code 세팅
- Path Alias
- 실행시간 측정
- 프레시업 #풀무원 #하루한병 #건강만들기 #풀무원 녹즙
- Emmet
- code .
- webstorm
- visual studio code cli
- code 설치
- GitLab Mirroring
- currentTimeMillis
- GitHub Mirroring
- 니돈내먹
- gitlab 연동
- settings sync
- GitHub 미러링
- eslint-import-resolver-typescript
- 초대장
- 음료같은녹즙
- 프리티어
- 네이버 클라우드 플랫폼
- 티스토리 초대장
- '티스토리 초대장/ 티스토리초대'
- GitLab미러링
- react native #gradle
- visual studio code
- 유니옥션
Archives
- Today
- Total
방치하기
홍대 자바 과제calculator -> C# 으로 사칙연산 계산기 인트.파스 가 핵심. 본문
반응형
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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Calc { public int a, b; public Calc( int a, int b) { this .a = a; this .b = b; } public void option(String opt) { if (opt== "+" ) { this .plus(); } else if (opt== "-" ) { this .minus(); } else if (opt== "/" ) { this .nanum(); } else if (opt== "*" ) { this .gob(); } else { } } public void plus() { System.Console.WriteLine( "더한 결과 " +( this .a+ this .b)); } public void minus() { System.Console.WriteLine( "뺀 결과 " +( this .a - this .b)); } public void nanum() { System.Console.WriteLine( "나누기 결과" + ( this .a / this .b)); } public void gob() { System.Console.WriteLine( "곱한 결과" + ( this .a * this .b)); } } class Calculator { public static void Main(String[] args){ System.Console.WriteLine( "숫자 1입력 해주세요" ); int a = int .Parse(Console.ReadLine()); System.Console.WriteLine( "숫자 2입력 해주세요" ); int b = int .Parse(Console.ReadLine()); System.Console.WriteLine( "연산자를 입력 해주세요" ); String c=Console.ReadLine(); Calc jh= new Calc(a,b); jh.option(c); } } } |
반응형
'프로그래밍 > C#' 카테고리의 다른 글
홍대 자바 수업 원주 ,넓이 구하는거-C# 생성자 사용 .. (0) | 2009.07.20 |
---|---|
부울형 C# 디비 개념 . 객체 지향 생성자 오버로딩 (0) | 2009.07.20 |
C# 제어문 . While문 특이해서 역시난 허접해 ㅠ 지금 현재 책본 부분까지 (0) | 2009.07.05 |