编程练习
自欺欺人被人欺
菜鸡萌新
展开
-
LeetCode: twosum
#include<stdio.h> #include<iostream> using namespace std; int main() { int *nums; int i, j, n, targe,a[2]; cin >> n; nums = (int*)malloc(sizeof(int)*n); for (i = 0; i < n; i++)原创 2017-09-28 15:39:48 · 137 阅读 · 0 评论 -
LeetCode:Reverse Integer
#include<iostream> #include<stdio.h> using namespace std; int reverse(int x) { int temp,sum=0; const int max = 0x7fffffff;//int 的最大值 const int min = 0x80000000; while (x != 0) {原创 2017-09-28 17:06:11 · 165 阅读 · 0 评论 -
LeetCode:Palindrome Number
#include<stdio.h> #include<iostream> #define true 1 #define false 0 using namespace std; int n; bool isPalindrome(int x) { int sum=0,temp; while (x!=0) { temp = x % 10; sum原创 2017-09-28 20:28:01 · 119 阅读 · 0 评论