Programming(122)
-
if~else, switch문
12345678910111213141516#include//짝수를 구하는 함수 bool odd(int n) { return n%2; //true와 1은 동일} int main() { int n; scanf("%d",&n); if (odd(n)) { printf("입력받은 n은 홀수입니다.\n"); }else { printf("입력받은 n은 짝수입니다.\n"); }}cs if~else, switch문 1234567891011121314151617181920212223242526272829303132333435363738394041#include int compare(int a, int b, int c) { int temp; if (a > b) { temp = a; }else { temp = b; } if ..
2017.02.13 -
데이터타입(기본, 파생형)
12345678910111213141516171819202122232425262728293031323334#include int main() { char a=128; //char는 문자/숫자 모두 가질 수 있다. printf("char a : %d \n", a); printf("char a : %c \n", a); unsigned char b = 255; printf("unsigned char b : %d \n", b); char c = 'a'; printf("char c : %c, %d \n", c, c); short int d = 32768; //16비트 printf("short int d : %d \n", d); short e = 32768; //int 생략 가능 printf("short e : %..
2017.02.13 -
파일 여러 개 업로드, 배열로 여러 값 넘기기
순서:1) input 태그 여러 개 넣기2) mhsr.getFiles() 이용해 여러 파일 받은 후, 반복문 돌리기3) list로 이미지 경로 받아와 출력 1) input 태그 여러 개 넣기**업로드할 파일 갯수 만큼 12345678 file: file: Colored by Color Scriptercs 2) mhsr.getFiles() 이용해 여러 파일 받은 후, 반복문 돌리기 123456789101112131415161718192021222324252627282930@RequestMapping(value="/insert.do", method=RequestMethod.POST) public String insert(Product product, Model model, HttpServletRequest ..
2017.02.06 -
8. 회원가입 폼
순서:1) 이름 공백 체크2) ID 중복 체크3) 패스워드 재확인 1) 이름 공백 체크 12345678 이름 : Colored by Color Scriptercs 123456789101112 var hasError = function(thisVal){ //switchClass 만약 바꿀 클래스가 없으면 그냥 더한다. $(thisVal).parents(".has-feedback").switchClass("has-success","has-error"); $(thisVal).siblings(".form-control-feedback").switchClass("glyphicon-ok","glyphicon-remove"); $(thisVal).siblings("input.check").val(0); } var h..
2017.02.02 -
SQL 정리
1단계:최대값 찾기 1SELECT MAX(num) AS MAXNUM FROM boardcs 2단계:조인하기(다른 테이블의 칼럼값도 가져올 때 사용) 1234SELECT b.*,a.photoFROM BOARD b LEFT OUTER JOIN BOARD_ALBUM aON b.num=a.board_numORDER BY b.num DESCcs 3단계:페이징 처리 **서브쿼리 중첩 이용일종의 필터 역할(endNum 아래로 끊고, startNum 위로 끊기) 12345678910 =#{startNum} ) WHERE row_numColored by Color Scriptercs
2017.01.31 -
부트스트랩(Bootstrap) 사용법
순서:1) Bootstrap 다운로드2) src >> resources 폴더에 저장3) header/footer.jsp에서 로딩4) 원하는 component 복붙 1) Bootstrap 다운로드 링크: http://getbootstrap.com/ 2) src >> resources 폴더에 저장 3) header/footer.jsp에서 로딩 12cs 123cs 4) 원하는 component 복붙 참고 사이트:http://getbootstrap.com/components/http://www.w3schools.com/bootstrap/default.asp
2017.01.25