练笔小程序
乔巴好萌
目前只会Go C++ python Java
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
水仙花数求解
/* 在数论中,水仙花数(Narcissistic number)也称为自恋数、自幂数、阿姆斯壮数或阿姆斯特朗数(Armstrong number),是指一N位数,其各个数之N次方和等于该数。 例如153、370、371及407就是三位数的水仙花数,其各个数之立方和等于该数: 153 = 13 + 53 + 33。 370 = 33 + 73 + 03。 371 = 33 + 7原创 2013-03-20 09:01:07 · 1149 阅读 · 0 评论 -
大数相加算法
/* author: openxmpp@163.com 由于GCC,VS的内置数据类型的加法受限于int,long,unsigned long等的精度,则对于大数的加法应采用字符串的形式进行输入和计算。 Problem Description I have a very simple problem for you. Given two integers A and B, your job原创 2013-03-21 11:52:30 · 5751 阅读 · 0 评论 -
C++字符串翻转操作
举例: I love cpp 翻转后 cpp love I 算法: 先翻转整个句子,再翻转每个单词 #include #include void reverseInPlace( char *input, int start, int end ) { char *s = input + start; char *e = input + end; w原创 2013-03-27 11:35:37 · 2635 阅读 · 0 评论 -
求逆序数
输入一个整数,如83721,输出其逆序数12738 #include using namespace std; int reverseNumber ( int input ) { int retval = 0; while ( input ) { int lowNumber = input % 10 ;原创 2013-03-27 21:35:06 · 991 阅读 · 0 评论 -
链表合并的递归和非递归方法
两个链表,已经有序排列,现在将其合并并输出新的链表 #include using namespace std; #include using std::vector; #include #ifndef _WIN32 #include #else #include #endif template struct Node { public: Node(T value)原创 2013-03-27 23:40:19 · 849 阅读 · 0 评论
分享