본문 바로가기

공부하며놀자/프로그래밍40

[leetcode] 9. Palindrome Number Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not. Example 1: Input: x = 121 Output: true Example 2: Input: x = -121 Output: false Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome. Example 3: Input: x.. 2021. 1. 15.
[leetcode] 7. Reverse Integer Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume the environment does not allow you to store 64-bit integers (signed or unsigned). Example 1: Input: x = 123 Output: 321 Example 2: Input: x = -123 Output: -321 Example 3: Input: x = 120 Output: 21 Example 4: Input.. 2021. 1. 15.
Visual Studio Post-build 적용하기 빌드를 하고 나서 output file을 다른 경로에 복사를 해야하는 경우가 있다. 반복적으로 디버깅을 해야한다면 매번 수동으로 옮기기는 너무 힘이 든다. 그럴 때는 빌드 후 이벤트로 복사를 걸어두면 된다. 프로젝트 우클릭해서 Properties 를 클릭하면 아래와 같은 창이 뜬다. (5) Command line 에 필요한 action을 넣어주면된다. set Dest=..\Bin //Dest라는 변수에 경로(path)를 설정 if not exist %Dest% mkdir %Dest% //Dest라는 경로가 없다면 make directory로 폴더를 만든다. copy "$(OutDir)\$(TargetName).*"%Dest% /y //output directory에 있는 파일을 Dest 경로로 복사해라... 2019. 7. 24.
[LeetCode] 2.Add Two Numbers (Medium) //#1 차 2019.04.11 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: long long powerOfTen(int num) { if(num == 0) return 1; else return 10*powerOfTen(num-1); } int listToNumbers(ListNode* l){ long long num=0; long long iDigit=0; int iTemp=0; do{ iTemp=0; iTemp = (unsigned int) l->val.. 2019. 4. 11.
반응형