题目如下:
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is al...
分类:
其他好文 时间:
2015-05-25 14:39:05
阅读次数:
140
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:
其他好文 时间:
2015-05-25 14:20:09
阅读次数:
97
问题:
在c中字符间转化可以以char a=char(b+5);的方式,但在java中却没用,这里给出一种转化方法:int c=b+5;char a=char(c);
String字符串,倒过来:
StringBffer str=new StringBuffer(s);
s=str.reverse().toString();
在测试时加入了一些输出语句,和一些小改动,在输出时忘记改回...
分类:
编程语言 时间:
2015-05-25 10:04:57
阅读次数:
137
第二道题
Add Two Numbers
如下:
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a singl...
分类:
编程语言 时间:
2015-05-23 08:50:29
阅读次数:
190
简单的字符串逆序输出。
AC代码:
#include
#include
using namespace std;
int main()
{
char str[100000];
int n;
while(cin >> n)
{
getchar();
for(int i = 0; i < n; i++)
{
gets(str);
int length = st...
分类:
其他好文 时间:
2015-05-22 17:13:25
阅读次数:
110
Reverse a singly linked list.思路:没啥好说的。秒...ListNode* reverseList(ListNode* head) { ListNode * rList = NULL, * tmp = NULL; while(head != N...
分类:
其他好文 时间:
2015-05-21 12:19:41
阅读次数:
145
反转链表,用了一个比较笨的方法。public class Solution { public ListNode reverseList(ListNode head) { if(head == null || head.next == null) retur...
分类:
其他好文 时间:
2015-05-21 00:00:01
阅读次数:
285
leetcode 2 – Add Two Numbers
题目:
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add t...
分类:
其他好文 时间:
2015-05-20 16:22:34
阅读次数:
110
Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->...
分类:
编程语言 时间:
2015-05-20 11:10:04
阅读次数:
280
javascript数组对象实例方法有:pop(),push(),reverse(),shift(),sort(),splice(),unshift(),concat(),join(),slice()pop() : 移除数组中最后一个元素,并返回该元素。 如下:var a=[1,2,3] ;cons...
分类:
编程语言 时间:
2015-05-20 01:56:22
阅读次数:
152