Groups
Groups
Sign in
Groups
Groups
星星爱CPP
Conversations
About
Send feedback
Help
星星爱CPP
1–30 of 33
Mark all as read
Report group
0 selected
bruc...@gmail.com
12/20/07
单循环打印向中心递增的矩形
#include <iostream> #include <iomanip> #include <cmath> #include <cassert>
unread,
单循环打印向中心递增的矩形
#include <iostream> #include <iomanip> #include <cmath> #include <cassert>
12/20/07
bruc...@gmail.com
2/13/07
一段windows下的计时代码
#include <windows.h> #include <stdio.h> class showtime_ { public: showtime_() {
unread,
一段windows下的计时代码
#include <windows.h> #include <stdio.h> class showtime_ { public: showtime_() {
2/13/07
bruc...@gmail.com
11/16/06
标准C++方法获取文件长度 [补充]
[原帖]http://groups.google.com/group/bruceteen/browse_thread/thread/90ef833dfbad9ab6 [补充] #include <
unread,
标准C++方法获取文件长度 [补充]
[原帖]http://groups.google.com/group/bruceteen/browse_thread/thread/90ef833dfbad9ab6 [补充] #include <
11/16/06
vvoody
,
BruceTeen
3
10/19/06
如何把gcc环境装入优盘中?
的确如此啊。好像是完整版的
unread,
如何把gcc环境装入优盘中?
的确如此啊。好像是完整版的
10/19/06
bruc...@gmail.com
9/29/06
显示当前日期时间2
#include <time.h> #include <stdio.h> int main( void ) { time_t t = time( 0 ); struct tm*
unread,
显示当前日期时间2
#include <time.h> #include <stdio.h> int main( void ) { time_t t = time( 0 ); struct tm*
9/29/06
bruc...@gmail.com
7/7/06
1000的阶乘 的尾部0的数目
#include <iostream> using namespace std; int main() { size_t m = 0; for( size_t n=1000; n; m+=n
unread,
1000的阶乘 的尾部0的数目
#include <iostream> using namespace std; int main() { size_t m = 0; for( size_t n=1000; n; m+=n
7/7/06
bruc...@gmail.com
, …
rain.man
7
6/15/06
Fibonacci非递归实现
好的,我学习学习.:) to楼上: 不用麻烦星星了,我这正好有个例子: http://groups.google.com/group/DataStream/browse_frm/thread/
unread,
Fibonacci非递归实现
好的,我学习学习.:) to楼上: 不用麻烦星星了,我这正好有个例子: http://groups.google.com/group/DataStream/browse_frm/thread/
6/15/06
bruc...@gmail.com
4/5/06
gcc中使用hash_map事例
#include <iostream> #include <string> #include <ext/hash_map> using namespace std;
unread,
gcc中使用hash_map事例
#include <iostream> #include <string> #include <ext/hash_map> using namespace std;
4/5/06
bruc...@gmail.com
3/23/06
树的读取和保存(未严格测试)
#include <iostream> #include <iomanip> #include <string> #include <vector> #
unread,
树的读取和保存(未严格测试)
#include <iostream> #include <iomanip> #include <string> #include <vector> #
3/23/06
bruc...@gmail.com
3/22/06
C中打印魔方阵
// 编译测试通过 by gcc3.4.2 // 编译参数中加 -std=c99 #include <stdio.h> #define N 3 int main() { int tmp[N]
unread,
C中打印魔方阵
// 编译测试通过 by gcc3.4.2 // 编译参数中加 -std=c99 #include <stdio.h> #define N 3 int main() { int tmp[N]
3/22/06
bruc...@gmail.com
3/9/06
获取字符串中的连续字母
#include <iostream> #include <string> #include <set> #include <algorithm> #
unread,
获取字符串中的连续字母
#include <iostream> #include <string> #include <set> #include <algorithm> #
3/9/06
bruc...@gmail.com
12/21/05
C99 中 _Complex 用法示例
float _Complex a = 1.1F + 2.2iF; // 关键字_Complex; 注意2.2后的i float a_real = __real__ a; // 关键字__real__
unread,
C99 中 _Complex 用法示例
float _Complex a = 1.1F + 2.2iF; // 关键字_Complex; 注意2.2后的i float a_real = __real__ a; // 关键字__real__
12/21/05
bruc...@gmail.com
11/17/05
[VC2005]存取类成员变量的汇编语法
本文根据[yangtze]同志的方法改编: struct foo { int a; int b; }; int main( void ) { struct foo bar = { 1, 2 };
unread,
[VC2005]存取类成员变量的汇编语法
本文根据[yangtze]同志的方法改编: struct foo { int a; int b; }; int main( void ) { struct foo bar = { 1, 2 };
11/17/05
bruc...@gmail.com
,
SevenCat
3
10/20/05
将输入的一行字符串排序(逆序)输出
#include <string> #include <algorithm> #include <iostream> int _tmain(int argc,
unread,
将输入的一行字符串排序(逆序)输出
#include <string> #include <algorithm> #include <iostream> int _tmain(int argc,
10/20/05
bruc...@gmail.com
, …
SevenCat
7
10/19/05
Java将寿终正寝
vb没有完全死,而且他已经完成了很多项目了。
unread,
Java将寿终正寝
vb没有完全死,而且他已经完成了很多项目了。
10/19/05
bruc...@gmail.com
10/18/05
Re: 判断输入字符串是否为回文
[C++代码:] #include <iostream> #include <string> #include <iterator> #include <
unread,
Re: 判断输入字符串是否为回文
[C++代码:] #include <iostream> #include <string> #include <iterator> #include <
10/18/05
bruc...@gmail.com
10/18/05
删除字符串中的空白字符
删除字符串中的空格 str.erase( remove_if( str.begin(), str.end(), bind1st(equal_to<char>(),' ') )
unread,
删除字符串中的空白字符
删除字符串中的空格 str.erase( remove_if( str.begin(), str.end(), bind1st(equal_to<char>(),' ') )
10/18/05
bruc...@gmail.com
10/13/05
读取文件内容 istream_iterator 和 istreambuf_iterator 的不同。
#include <fstream> #include <iterator> #include <vector> #include <algorithm>
unread,
读取文件内容 istream_iterator 和 istreambuf_iterator 的不同。
#include <fstream> #include <iterator> #include <vector> #include <algorithm>
10/13/05
bruc...@gmail.com
10/13/05
标准C++方法获取文件长度
#include <fstream> #include <cstdio> using namespace std; int main( void ) { fstream file
unread,
标准C++方法获取文件长度
#include <fstream> #include <cstdio> using namespace std; int main( void ) { fstream file
10/13/05
bruc...@gmail.com
10/11/05
求 n! 尾部连续0的数目 和 尾部第一个非零数字
size_t foo( size_t n ) // 求n!分解质因子中5的数目 == 求n!尾部零数字位数目 { size_t m = 0; for( ; n!=0; n/=5, m+=n );
unread,
求 n! 尾部连续0的数目 和 尾部第一个非零数字
size_t foo( size_t n ) // 求n!分解质因子中5的数目 == 求n!尾部零数字位数目 { size_t m = 0; for( ; n!=0; n/=5, m+=n );
10/11/05
bruc...@gmail.com
10/10/05
如何判断一个数是否为11的倍数
问: 给定一个整数,最多1000位,如何判断他能不能被11整除? eastcowboy 答: 所有奇数位数字相加,所有偶数位数字相加。把这两个和相减。 如果差是11的倍数,则原数可以被11整除,否则不能
unread,
如何判断一个数是否为11的倍数
问: 给定一个整数,最多1000位,如何判断他能不能被11整除? eastcowboy 答: 所有奇数位数字相加,所有偶数位数字相加。把这两个和相减。 如果差是11的倍数,则原数可以被11整除,否则不能
10/10/05
bruc...@gmail.com
3
10/7/05
反驳"中国人没有自己的操作系统和编译器是一种悲哀"
通俗简单的比喻:有个恶霸打了你们, 如果你不想反抗并冷嘲热讽其他反抗的人,那么你是贱人,天生的贱骨头; 如果你抡起拳头打恶霸,那么你是血性汉子,不过血性汉子和恶霸又有多大区别呢? 如果你联合别人,建立
unread,
反驳"中国人没有自己的操作系统和编译器是一种悲哀"
通俗简单的比喻:有个恶霸打了你们, 如果你不想反抗并冷嘲热讽其他反抗的人,那么你是贱人,天生的贱骨头; 如果你抡起拳头打恶霸,那么你是血性汉子,不过血性汉子和恶霸又有多大区别呢? 如果你联合别人,建立
10/7/05
bruc...@gmail.com
10/7/05
metaprogam用法一例
题目:计算 1!+2!+3!+4!+ ...+n! 答案: template<size_t n> struct factorial { enum{ val = n * factorial
unread,
metaprogam用法一例
题目:计算 1!+2!+3!+4!+ ...+n! 答案: template<size_t n> struct factorial { enum{ val = n * factorial
10/7/05
bruc...@gmail.com
9/29/05
统计文件中单词数量
[题目] 假设文件中的单词为由一个或多个空字符分隔的字符串,编写一个程序,计算指定文件中的单词数。 [答案] #include <iostream> #include <
unread,
统计文件中单词数量
[题目] 假设文件中的单词为由一个或多个空字符分隔的字符串,编写一个程序,计算指定文件中的单词数。 [答案] #include <iostream> #include <
9/29/05
bruc...@gmail.com
9/28/05
'\09' 是什么?
[问] cout << '\09' << endl; 为什么输出57? [答] 首先八进制的写法是 \ooo,也就是说 \ 后面最多可带三个数,比如 \071
unread,
'\09' 是什么?
[问] cout << '\09' << endl; 为什么输出57? [答] 首先八进制的写法是 \ooo,也就是说 \ 后面最多可带三个数,比如 \071
9/28/05
bruc...@gmail.com
9/28/05
单循环打印出菱形图
#include <iostream> #include <iomanip> #include <cmath> #include <cassert>
unread,
单循环打印出菱形图
#include <iostream> #include <iomanip> #include <cmath> #include <cassert>
9/28/05
bruc...@gmail.com
9/28/05
string和CString风格的不同
/* 问:[coolfreezing] 个人认为C++的string功能没有MFC的CString强大。不知是我学艺不精还是确实如此。 尤其是在拼接字符串时,没有%d, %s用着那么方便。 当然我说的是
unread,
string和CString风格的不同
/* 问:[coolfreezing] 个人认为C++的string功能没有MFC的CString强大。不知是我学艺不精还是确实如此。 尤其是在拼接字符串时,没有%d, %s用着那么方便。 当然我说的是
9/28/05
bruc...@gmail.com
9/16/05
ifstream读取二进制文件内容
// 方法1 #include <fstream> #include <vector> #include <iostream> using namespace std
unread,
ifstream读取二进制文件内容
// 方法1 #include <fstream> #include <vector> #include <iostream> using namespace std
9/16/05
bruc...@gmail.com
9/13/05
最大公约数 and 最小公倍数
// 求最大公约数(greatest common divisor) template <typename T> inline T GCD( T a, T b ) { // 此函数能够被执行
unread,
最大公约数 and 最小公倍数
// 求最大公约数(greatest common divisor) template <typename T> inline T GCD( T a, T b ) { // 此函数能够被执行
9/13/05
bruc...@gmail.com
9/11/05
分解质因子
#include <iostream> #include <cassert> using namespace std; void foo( unsigned int n ) {
unread,
分解质因子
#include <iostream> #include <cassert> using namespace std; void foo( unsigned int n ) {
9/11/05