Skip to content

Commit c68c23c

Browse files
add readme
1 parent 7bca58f commit c68c23c

File tree

7 files changed

+58
-0
lines changed

7 files changed

+58
-0
lines changed

C/1-50/6-ZigZag-Conversion.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/*
2+
* Created by supercoderhawk on 2017/7/24.
3+
*/
4+

C/233-Number-of-Digit-One.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// Created by supercoderhawk on 2017/7/19.
3+
//
4+
5+
/*
6+
* Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.
7+
*
8+
* For example:
9+
* Given n = 13,
10+
* Return 6, because digit 1 occurred in the following numbers: 1, 10, 11, 12, 13.
11+
*/
12+
13+
int countDigitOne(int n) {
14+
int count = 0,digitsCount = 1,nClone = n;
15+
while(nClone >= 10){
16+
digitsCount += 1;
17+
nClone/=10;
18+
}
19+
nClone = n;
20+
int digits[digitsCount];
21+
for(int i = digitsCount-1;i>=0;i--)
22+
{
23+
digits[i] = nClone%10;
24+
nClone /= 10;
25+
}
26+
return 0 ;
27+
28+
}

C/CMakeLists.txt

Whitespace-only changes.

C/headers/problem_1_50.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Created by supercoderhawk on 2017/7/23.
3+
*/
4+
5+
#ifndef C_PROBLEM1_50_H
6+
#define C_PROBLEM1_50_H
7+
8+
#endif //C_PROBLEM1_50_H

C/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//
2+
// Created by xyb-C308 on 2017/7/19.
3+
//
4+

C/main.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//
2+
// Created by xyb-C308 on 2017/7/19.
3+
//
4+
5+
#ifndef C_MAIN_H
6+
#define C_MAIN_H
7+
8+
#endif //C_MAIN_H

ReadMe.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# leetCode 刷题代码库
2+
3+
## 文件夹
4+
* C: C语言,IDE为CLion
5+
* Java: Java语言,使用maven管理依赖,使用junit测试,IDE为Intellij IDEA
6+
* Python: Python语言,IDE为PyCharm

0 commit comments

Comments
 (0)