C++程序设计教程 源码
生无涯
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
f03056.cpp 读入一串以回车结尾带空格的字符序列
//==================== //f03056.cpp //读入一串以回车结尾带空格的字符序列 //==================== #include //#include #include using namespace std; //-------------------- void readGetChar() { //字符,cin.get() for(char ch; (ch = cin.get()) != '/n';) cout原创 2011-03-09 22:12:00 · 1530 阅读 · 0 评论 -
常量引用型形参躲避模板类型参数精确匹配
常量引用型形参躲避模板类型参数精确匹配原创 2011-04-17 16:12:00 · 785 阅读 · 0 评论 -
利用栈判断车厢顺序安排的可行性
/** Copyright (c) leo* All rights reserved.* filename: f0606.cpp* summary : 利用栈判断车厢顺序安排的可行性* version : 1.0* author : leo* date : 6.06.2011*///====================================原创 2011-06-06 11:35:00 · 1189 阅读 · 0 评论 -
mianArg.cpp 使用mian函数的参数 f0512.cpp
使用mian函数的参数原创 2011-06-02 10:57:00 · 702 阅读 · 0 评论 -
f0508.cpp 函数指针向量实现菜单驱动函数调用
函数指针向量实现菜单驱动函数调用原创 2011-05-29 11:32:00 · 950 阅读 · 0 评论 -
向量常用操作
向量常用操作 c++原创 2011-04-06 14:41:00 · 534 阅读 · 0 评论 -
若干向量按长短排列
若干向量按长短排列原创 2011-04-06 15:13:00 · 563 阅读 · 0 评论 -
f0306.cpp string流,getline整行读入,分解读入
<br />//==================== //f0306.cpp //string流,getline整行读入,分解读入 //==================== #include<iostream> #include<string> #include<sstream> #include<fstream> using namespace std; //==================== int main () { ifstream in原创 2011-03-10 10:24:00 · 1278 阅读 · 0 评论 -
f0305.cpp 字符串操作
<br />//==================== //f0305.cpp //字符串操作 //==================== #include<iostream> #include<algorithm> #include<string> using namespace std; //-------------------- int main() { string a, s1 = "hello "; string s2 = "123"; a = s1; //复原创 2011-03-09 20:44:00 · 556 阅读 · 0 评论 -
f0211.cpp 利用文件输入输出流复制文件
<br />//=============================== //f0211.cpp //利用文件输入输出流复制文件 //=============================== #include<sstream> #include<fstream> using namespace std; //------------------------------- int main() { ifstream in("a.txt"); ofstream out("b原创 2011-03-06 10:28:00 · 881 阅读 · 0 评论 -
f803.cpp
<br />//===================== //f0803.cpp //对象指针使用成员函数 //===================== #include<iostream> #include<iomanip> using namespace std; //---------------------- class Date { int year; int month; int day; public: void set(int y,int m,int原创 2011-03-04 16:05:00 · 570 阅读 · 0 评论 -
f0304.cpp c串操作
<br />//==================== //f0304.cpp //c串操作 //==================== #include<iostream> using namespace std; //-------------------- int main() { char * str = "hello"; cout << *str <<endl; //h cout << str <<endl; //hello cout << ("jion"原创 2011-03-08 10:16:00 · 558 阅读 · 0 评论 -
f0218.cpp 级数逼近求PI
<br />//=============================== //f0218.cpp //级数逼近求PI:PI/4 = 1 - 1/3 + 1/5 - 1/7 + ...... //=============================== #include<iostream> #include<cmath> using namespace std; //------------------------------- double getPI() { double原创 2011-03-06 17:11:00 · 889 阅读 · 0 评论 -
f1513.cpp 非错误异常,跳出深循环
//=============================== //f1513.cpp //非错误异常,跳出深循环 //=============================== #include #include #include using namespace std; //------------------------------- void printYesorNoPrime(int m) { try { for(int i = 2;i原创 2011-03-06 11:09:00 · 561 阅读 · 0 评论 -
f02089.cpp 流状态
<br />//====================== //f02089.cpp //流状态 //===================== #include<iostream> #include<iomanip> using namespace std; //--------------------- int main() { cout << showpos << 12 <<endl; //showpos:0和正数前显示+ cout << hex << 18 << " "原创 2011-03-06 09:52:00 · 479 阅读 · 0 评论 -
f0208.cpp 判断一个数是否是素数
<br />//====================== //f0208.cpp //判断一个数是否是素数 //===================== #include<iostream> #include<cmath> using namespace std; //--------------------- bool isPrime(int m); //--------------------- bool isPrime(int m) { double sqrtm = s原创 2011-03-05 20:47:00 · 786 阅读 · 0 评论 -
f0216.cpp 百元买白鸡问题
<br />//=============================== //f0216.cpp //百元买白鸡问题 //=============================== #include<iostream> using namespace std; //------------------------------- void buyChick() { for(int cock = 1; cock <= (100 - 6)/7; cock++) for(i原创 2011-03-06 15:11:00 · 914 阅读 · 0 评论 -
f0212.cpp 筛法求区间内的素数,判定给定数是否为素数
<br />//=============================== //f0212.cpp //筛法求区间内的素数,判定给定数是否为素数 //=============================== #include<iostream> #include<vector> #include<fstream> using namespace std; //------------------------------- int main() { vector<int> p原创 2011-03-06 10:50:00 · 871 阅读 · 0 评论 -
f0802
<br />//===================== //f0802.cpp //日期类应用程序 //===================== #include<iostream> #include<iomanip> using namespace std; //---------------------- class Date { int year; int month; int day; public: void set(int y,int m,int day原创 2011-03-04 14:48:00 · 681 阅读 · 0 评论 -
f0801
//===================== //f0801.cpp //日期类型结构 //===================== #include #include using namespace std; //---------------------- struct Date { int year; int month; int day; }; //----------------------- void print(Date); bool isLeapYe原创 2011-03-03 17:25:00 · 591 阅读 · 0 评论
分享