목록전체 글 (240)
S_pot
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp6 { class Program { static void Main(string[] args) { string s = Console.ReadLine(); string[] ss = s.Split(); int hour = int.Parse(ss[0]); int min = int.Parse(ss[1]); if (min - 45 < 0) { Console.Write(hour - 1); Console.Write(" "); Console.WriteLine((min - 45) +..
try-catch문: try가 감싸고 있던 명령문에서 예외가 발생하면 catch문에 저장된 명령을 실행하도록 함. 예외처리 private void BM_WokerMaster_Load(object sender, EventArgs e) { try { #region // 그리드 셋팅을 위한 _GridUtil.InitializeGrid(this.grid1, false, true, false, "", false); _GridUtil.InitColumnUltraGrid(grid1, "PLANTCODE", "공장", true, GridColDataType_emu.VarChar, 130, 200, Infragistics.Win.HAlign.Left, true, true); _GridUtil.InitC..
this키워드는 객체가 자기 자신을 지칭할 때 사용 클래스 내부에서 필드명과, 메서드의 매개 변수의 이름이 동일할 때 this 키워드로 모호성을 제거 this가 붙은 변수는 클래스의 자신의 필드이며 그 외는 매개 변수이다. using System; namespace This { class Employee { private string Name; private string Position; public void SetName(string Name) { this.Name = Name; }
14503번: 로봇 청소기 (acmicpc.net)

데이터 형식을 varchar로 설정해주고 insert할때 N을 붙여준다. ex) N'한글' create table "dept" (deptno char(3), dname nvarchar(20)); insert into dept values('101', N'경영학과');
-- grade컬럼 숫자 1자 제한, check제약조건 alter table student alter column grade numeric(1); alter table student add constraint grade_ck check (grade in(1,2,3,4));
-- dept테이블의 deptno를 참조하는 외래키적용 alter table student add constraint student_fk foreign key(deptno) references dept(deptno);
Unique: Unique 제약조건을 설정하면, 해당 컬럼은 서로 다른 값을 가져야 한다. 테이블을 생성할 때 적용 CREATE TABLE Test ( ID INT UNIQUE, Name VARCHAR(30), ReserveDate DATE, RoomNum INT ); ALTER문으로 적용할 때 ALTER TABLE Reservation ADD CONSTRAINT reservedRoom UNIQUE (RoomNum);
-- deptno컬럼을 not null로 설정 후 기본키로 지정 alter table dept alter column deptno char(3) not null; alter table dept add constraint dept_pk primary key(deptno);

#!/bin/bash array=(5 3 7 2 9) for item in ${array[@]} do echo $item done 타입에 구애받지 않고 출력됨 #!/bin/bash array=(5 "apple" 7 3.14 9) for item in ${array[@]} do echo $item done 아래로 정렬이 아닌 옆으로 값을 정렬하고 싶으면 echo를 사용 #!/bin/bash array=(5 "apple" 7 3.14 9) echo ${array[@]}