#include
/*
这个字符串参数必须包含一个或者多个数字,函数应该把这些数字字符转换为整数并返回这个整数。
如果字符串参数包含了任何非数字字符,函数就返回零。
*/
int ascii_to_integer(char *str)
{
int i=0;
while(*str!='\0')
{
if(*str'9')
return 0;
i*=10; ...
分类:
编程语言 时间:
2015-03-10 23:10:16
阅读次数:
214
题目:传送门题目描述This is a very simple problem, just like previous one.You are given a postive integer n, and you need to divide this integer into m pieces. ...
分类:
其他好文 时间:
2015-03-10 22:44:56
阅读次数:
124
Sub RenameSheet()
Dim i As Integer
For i = 1 To Sheets.Count
Sheets(i).Name = Sheets(i).Range("A1").Value
Next
End Sub...
分类:
编程语言 时间:
2015-03-10 21:35:25
阅读次数:
281
题目:传送门题目描述You are given an integer array s[] and are asked to count how many positions a, b, c and d satisfy the condition: s[a] + s[b] + s[c] == s[d]...
分类:
其他好文 时间:
2015-03-10 21:16:32
阅读次数:
146
题目:传送门题目描述整数划分是一个非常经典的数学问题。所谓整数划分,是指把一个正整数n写成为n=m1+m2+...+mi的形式,其中mi为正整数,并且1#include #include #include #include #include #define inf 0x3f3f3f3f#includ...
分类:
其他好文 时间:
2015-03-10 21:06:58
阅读次数:
166
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit in...
分类:
其他好文 时间:
2015-03-10 19:15:05
阅读次数:
150
There areNintegers in an arrayA. All but one integer occur in pairs. Your task is to find the number that occurs only once.Sample Input:231 1 2Sample ...
分类:
其他好文 时间:
2015-03-10 19:14:54
阅读次数:
152
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit in...
分类:
其他好文 时间:
2015-03-10 19:12:29
阅读次数:
126
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other
Given an integer n, return all distinct solutions to the n-queens puzzle.
Ea...
分类:
其他好文 时间:
2015-03-10 17:16:38
阅读次数:
161
1.建表本例选择Sql Server2008作为数据库 在MySQL中新增一个ztest数据库,建立CUSTOMER 表CREATE TABLE CUSTOMER( CID INTEGER NOT NULL PRIMARY KEY, USERNAME VARCHAR(12) NOT N...
分类:
编程语言 时间:
2015-03-10 15:23:05
阅读次数:
193