본문 바로가기

전체 글20

[이산수학]#1 관계와 표현 더보기관계(이항관계) : aRb집합 A,B가 있을 때 A에서 B로 가는 관계로, AxB의 부분집합더보기역(dom)-정의역(Domain, dom(R))집합 A에서 B로 가는 이항관계 R속에 속한 순서쌍의 첫 번째 원소가 포함되어 있는 집합 즉, 집합 A -공변역(Codomain, codom(R))집합 A에서 B로 가는 이항관계 R에 속학 순서싸의 두 번째 원소가 포함되어 있는 집합 즉, 집합 B -치역(Range, ran(R))집합 A에서 B로 가는 관계 R에 속한 순서쌍의 두번 쨰 원소들을 모아놓은 집합 즉, 공변역의 부분집합 더보기n항 관계(n-ray Relation)집합 A1, A2, A3 ... 가 있을 때 A1xA2xA3x ... 의 부분집합역관계(R-1)집합 A에서 B로 가는 관계 R이 있을 떄.. 2022. 11. 10.
[C] 배열 순서 거꾸로 하기 더보기 배열 순서 거꾸로 하기 #include #include int main(void){ int arrr[6] = {1,2,3,4,5,6}; int temp; int *ptrr1 = &arrr[0]; int *ptrr2 = &arrr[5]; for(int i=0; i 2022. 11. 6.
[c] 화씨/섭씨 변환 더보기 화씨/섭씨 변환 #include int changetoF(int a){ double result; result=a*(1.8)+32; printf("%lf\n",result); return result; } int changetoC(int a){ double result; result=(a-32)/1.8; printf("%lf\n",result); return result; } int main(void){ while(1){ double num; int s; printf("(1)화씨로 변환 (2)섭씨로 변환 (3)종료 :"); scanf("%d", &s); switch(s){ case 1: printf("input: "); scanf("%lf", &num); changetoF(num); break; .. 2022. 11. 6.
[c] 문자열 단어 개수 구하기 더보기 문자열 단어 개수 구하기 #include #include int main(void) { char p[100] = "a book and pencil"; int cnt = 0; for (int i = 0; i < strlen(p); i++) { if (p[i] != ' ' && p[i] != '\n') cnt++; else{ continue; } } printf("word count: %d\n", cnt); return 0; } // ctype.h 이용 #include #include #include int main(void){ char s[10000] = "a book is not good for my health"; int count=0; for(int i = 0; i< strlen(s); i++.. 2022. 11. 6.
[JAVA] VSCode - Build failed, do you want to continue? 더보기 빌드 실패팝업 무시하고 실행하는 방법 [Ctrl + , ]로 설정 진입하기 (맥은 cmd+, ) 확장 java Debugger Force build before Launch 체크하기 2022. 11. 6.
[JAVA]split() 더보기 split() String[] temp = str.split("\t"); //특정 문자를 기준으로 문자열을 나눈다. // "temp=SUNDAYMONDAY" 일 경우 // temp[0]=SUNDAY, temp[1]=MONDAY 2022. 11. 6.
[JAVA]nextLine(), hasNextLine() 더보기 hasNextLine(); while(scan.hasNextLine()) { String str = scan.nextLine(); //스캐너 객체가 읽을 다음줄이 존재하는가에 대한 Boolean 값 더보기 nextLine(); while(scan.hasNextLine()) { String str = scan.nextLine(); String[] temp = str.split("\t"); //scaner 객체의 내용을 '줄' 단위로 가져온다. //위의 코드는 읽을 '줄'이 사라질 때까지 str에 각 줄의 내용을 대입 2022. 11. 6.
[JAVA]문자열 앞뒤의 공백을 제거하기 더보기 1.trim() String str = " Hello "; Strint trimstr = str.trim(); System.out.println(trimstr); //실행결과 Hello 더보기 2.strip() String str = " Hello "; Strint stripstr = str.strip(); System.out.println(stripstr); //실행결과 Hello 2022. 11. 6.
HTML#3 이미지, 표 더보기 이미지 태그 이미지 경로 1. 인터넷 이미지 주소 2. html 파일있는 폴더 안에 이미지 파일 폴더 안의 이미지 파일 이용 >> (src="./image/coding.png") >>현재 폴더의 상위 폴더에서의 이미지 사용: "../images/coding.png" 크기 속성(px) >> width, height 더보기 표 >> 테이블 >> 표 설명,제목 >> 행 >> 데이터 셀 2022. 10. 27.