본문 바로가기

비주얼스튜디오7

[프로그래머스 level1]가운데 글자 가져오기 c# public class Solution { public string solution(string s) { string answer = ""; if(s.Length%2==0) { answer=s.Substring((s.Length/2)-1,2); }else { answer=s.Substring(s.Length/2,1); } return answer; } } 2020. 7. 3.
[C#]윈폼(Windows Form)에 마우스 이벤트로 폼 배경 변경(랜덤) 마우스 왼쪽 버튼을 누르면 윈도우 배경색을 랜덤으로 바꿔준다 마우스 오른쪽 버튼 누르면 사진배경을 띄워준다 마우스 휠을 움직이면 창이 투명해지게 만들어준다. using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; using System.Windows.Forms; using System.Drawing; using System.Diagnostics; namespace ConsoleApp1 { class MainApp:Form { Random rand; public MainApp() { .. 2020. 6. 16.
[C#]문자열을 입력받아 아스키코드로 분류 문자열을 입력받아 아스키코드를 이용해 대문자, 소문자, 숫자, 특수문자를 구분하라 ASnvsdk45/* 대문자: 2 소문자: 5 숫자: 2 특수문자: 2 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp17 { class Program { static void Main(string[] args) { Console.WriteLine("문자열을 입력해주세요:"); char[] a ; int c1=0, c2=0, c3=0,c4=0; a = Console.ReadLine().ToCharAr.. 2020. 6. 16.
[C#]람다식을 이용하여 계산기 클래스 만들기 using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace ConsoleApp16 { class Program { class Calculrator //계산기 클래스 생성 { public int Plus(int a,int b) => a + b; public int Minus(int a, int b) => a - b; public int Multiple(int a, int b) => a * b; public double Divide(int a, int b).. 2020. 6. 15.