C/C++
文章平均质量分 63
linux_start
java php C C 现在在学php 还有java 有时间学C 熟悉ph p Java了解 C/C
展开
-
page64
// page64.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计#include "stdafx.h"#include using namespace std;//C++标准程序库中的所有标识符都被定义于一个名为std的namespace中。 int main (){ char ans ; do { cout cout原创 2012-05-27 12:04:16 · 332 阅读 · 0 评论 -
PAGE208_19
// page208_19.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计 #include "stdafx.h"#include void introduction();//后条件:在屏幕上输出程序说明int _tmain(int argc, _TCHAR* argv[]){ using namespace std ; int a原创 2012-06-08 08:22:40 · 408 阅读 · 0 评论 -
page199
// page199.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计//get_input 函数的驱动程序#include "stdafx.h"#include void get_input(double& cost , int& turnover);// 前条件:用户准备好输入正确的值//后条件:cost的值设为一件商品的批发价//turno原创 2012-06-06 22:23:21 · 327 阅读 · 0 评论 -
page196
// page196.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计//根据Quick_shop连锁超市的定价策略来确定一件商品的零售价#include "stdafx.h"#include const double LOW_MARKUP = 0.05 ; //低涨幅5%const double HIGH_MARKUP = 0.10;// 高涨幅10%原创 2012-06-06 10:42:04 · 522 阅读 · 0 评论 -
page191
// page191.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//练习输出结果//传引用调用和传值调用的思路这个小题就能说明白#include "stdafx.h"#include void figure_me_out(int& x , int y , int& z);int _tmain(int argc, _TCHAR* argv[])原创 2012-06-06 11:24:02 · 364 阅读 · 0 评论 -
page192
// page192.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计//该程序用于演示一个函数调用另一个函数#include "stdafx.h"#include void get_input(int& input1 , int& input2);//从键盘读取两个整数void swap_values (int& variable1 , int&原创 2012-06-05 21:04:31 · 315 阅读 · 0 评论 -
page190
// page190.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计 //演示传引用调用参数的程序#include "stdafx.h"#include void get_numbers(int& input1 ,int& input2);//从键盘读取两个整数void swap_values(int variable1 , int variable原创 2012-06-05 12:56:00 · 394 阅读 · 0 评论 -
page189
// page189.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//展示传值调用参数和传引用调用参数的区别#include "stdafx.h"#include void do_stuff(int par1_value , int& par2_ref);//par1_value 是传值调用参数 , par2_ref是传引用调用参数int _tma原创 2012-06-05 08:15:05 · 346 阅读 · 0 评论 -
page184
// page184.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//传引用调用形参#include "stdafx.h"#include void get_numbers( int& intput1 , int& intput2);//从键盘读取两个整数void swap_values(int& variable1 , int&variable2原创 2012-06-04 12:08:47 · 429 阅读 · 0 评论 -
page168
// page168.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计// 判断圆形皮萨和矩形皮萨,哪一种更适合购买#include "stdafx.h"#include double unitprice(int diameter , double price );//返回圆形皮萨每平方英寸的价格。形参的啊meter是以英寸为单位的皮萨直径,形参pri原创 2012-06-03 12:36:39 · 321 阅读 · 0 评论 -
page203
// page203.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计// 有bug的温度换算程序#include "stdafx.h"#include using namespace std ;int _tmain(int argc, _TCHAR* argv[]){ double fahrenhit ; double cel原创 2012-06-07 22:08:24 · 310 阅读 · 0 评论 -
page208-19
// page208_19.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计 #include "stdafx.h"#include void introduction();//后条件:在屏幕上输出程序说明int _tmain(int argc, _TCHAR* argv[]){ using namespace std ; int a原创 2012-06-08 08:22:02 · 1007 阅读 · 0 评论 -
page200
// page200.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//根据Quick_shop连锁超市的定价策略来判断一件商品的零售价#include "stdafx.h"#include void introduction();//后条件:在屏幕上输出程序说明void get_input( double& cost , int& turnov原创 2012-06-07 08:53:53 · 566 阅读 · 0 评论 -
page49
// page49.cpp : 定义控制台应用程序的入口点。//c++面下对象程序设计 清华大学出版社 第七版#include "stdafx.h"#include #include using namespace std;int main(){ string middle_name ,pet_name; string alter_ego_name; /原创 2012-05-25 12:18:22 · 243 阅读 · 0 评论 -
page15 C++
// page15.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计(第七版) 清华大学出版社#include "stdafx.h"#include using namespace std;int main(){ int number_of_pods , peas_per_pod , total_peas ; cout cout ci原创 2012-05-23 15:59:12 · 310 阅读 · 0 评论 -
page56
// page56.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计 #include "stdafx.h"#include using namespace std;int main(){ int hours ; double gross_pay , rate; cout cin >> rate ; cout原创 2012-05-26 14:48:20 · 359 阅读 · 0 评论 -
page31
// page31.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计#include "stdafx.h"#include using namespace std;int main (){ int number_of_bars;//糖的数量 double one_weight, total_weight;//每块糖的质量和总的数量 cou原创 2012-05-24 16:25:51 · 279 阅读 · 0 评论 -
page48
// page48.cpp : 定义控制台应用程序的入口点。//char 类型 C++面向对象程序设计#include "stdafx.h"#include using namespace std;int main(){ char symbol1 , symbol2, symbol3; cout cin >> symbol1 >> symbol2; co原创 2012-05-25 10:37:23 · 290 阅读 · 0 评论 -
page226
// page226.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计//从用户指定的文件读取3个数,求和,并将结果写入用户指定的另一个文件#include "stdafx.h"#include #include #include int main(){using namespace std ;int a ;c原创 2012-06-13 22:20:59 · 349 阅读 · 0 评论 -
page217
// page217.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//从文件infile.dat读取3个数,求和,将结果写入outfile.dat//(该程序的一个更好的版本将在图给出)#include "stdafx.h"#include #include int main(){ using namespace std ; int原创 2012-06-11 23:02:47 · 336 阅读 · 0 评论 -
page224
// page224.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计//将数据追加到data.txt文件的末尾#include "stdafx.h"#include #include int _tmain(int argc, _TCHAR* argv[]){ using namespace std; int a; cout o原创 2012-06-11 23:05:37 · 354 阅读 · 0 评论 -
page221
// page221.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//从文件infile.datzhong读取3个数,求和,将文件写入文件outfile.dat#include "stdafx.h"#include #include #include int _tmain(int argc, _TCHAR* argv[]){using原创 2012-06-11 23:04:47 · 350 阅读 · 0 评论 -
page166
// page166.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//演示对函数名ave的重载#include "stdafx.h"#include double ave(double n1 , double n2);//返回两个数字n1和n2的平均值double ave (double n1 , double n2 ,double n3);/原创 2012-06-03 11:02:47 · 320 阅读 · 0 评论 -
page182
// page182.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//这是一个练习#include "stdafx.h"#include void friendly();void shy(int audience_count );int _tmain(int argc, _TCHAR* argv[]){ int a; using nam原创 2012-06-04 11:37:12 · 267 阅读 · 0 评论 -
page107
// page107.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计//演示for循环#include "stdafx.h"#include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ int sum = 0 ; for (int n = 0 ; n {原创 2012-05-30 21:32:47 · 266 阅读 · 0 评论 -
page98
// page98.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计// 计算批发或零售交易的总价款#include "stdafx.h"#include using namespace std;const double TAX_RATE = 0.75;//5%的销售税int _tmain(int argc, _TCHAR* argv[]){原创 2012-05-29 21:59:52 · 257 阅读 · 0 评论 -
page97
// page97.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计// 该程序用于提供家庭作业信息#include "stdafx.h"#include using namespace std;int main(){ int choice; do { cout cin >原创 2012-05-29 16:49:03 · 266 阅读 · 0 评论 -
page96
// page96.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ int vehicle_class;// vehicle_class 代表车的种类 double toll; cout原创 2012-05-29 16:47:38 · 267 阅读 · 0 评论 -
page92
// page92.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计//该程序用于计算州的收入税#include "stdafx.h"#include using namespace std ;// 这个程序返回州收入金额,计算方式如下://$15,000一下的部分免税:$15,001--$25,000之间税率5%:超过$25,000税率为10&原创 2012-05-28 19:07:51 · 339 阅读 · 0 评论 -
page69
// page69.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计 清华大学出版#include "stdafx.h"#include using namespace std;int main (){ double balance = 50.00 ; int count = 0; cout while (原创 2012-05-27 19:19:50 · 338 阅读 · 0 评论 -
page62
// page62.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计#include "stdafx.h"#include using namespace std;int main(){ int count_down; cout cin >> count_down; while (count_down >0) { cout原创 2012-05-27 10:41:08 · 284 阅读 · 0 评论 -
page94
// page94.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计// 该程序演示switch语句#include "stdafx.h"#include using namespace std ;int main (){ char grade ; cout cin >> grade ; switch(grade) { ca原创 2012-05-28 21:43:21 · 365 阅读 · 0 评论 -
page89
// page89.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计//演示花括号在 if-else语句的重要作用#include "stdafx.h"#include using namespace std ;int main(){ double fuel_gauge_reading; cout cin >> fuel_gauge原创 2012-05-28 18:19:18 · 515 阅读 · 0 评论 -
page111
// page111.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计//累加10个负数#include "stdafx.h"#include using namespace std;int main(){ int number ,sum = 0 , count = 0 ; cout while( ++count { cin原创 2012-05-30 22:14:20 · 263 阅读 · 0 评论 -
page117
// page117.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//计算路劲秃鹰产卵总数//由保护区的所有动物保护学者统计#include "stdafx.h"#include using namespace std ;int main(){ cout int number_o原创 2012-05-31 08:46:19 · 285 阅读 · 0 评论 -
page104
// page104.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//卡里路统计程序#include "stdafx.h"#include using namespace std ;int _tmain(int argc, _TCHAR* argv[]){ int number_of_items , count , calories_原创 2012-05-30 17:03:15 · 321 阅读 · 0 评论 -
page180
// page180.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//这个程序将华氏温度换为摄氏温度#include "stdafx.h"#include void initialize_screen();//将当前输出与上一个程序的输出分开double celsius(double fahrenheit);//将华氏温度算为摄氏温度voi原创 2012-06-04 10:53:02 · 317 阅读 · 0 评论 -
page152
// page152.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//判断两种披萨哪种最适合购买#include "stdafx.h"#include using namespace std ;double unitprice (int diameter ,double price);//返回披萨每平方英寸的价格//形参diameter是以英寸原创 2012-06-01 19:55:39 · 328 阅读 · 0 评论 -
page160
// page160.cpp : 定义控制台应用程序的入口点。//C++ 面向对象程序设计//律师事务所计费程序#include "stdafx.h"#include using namespace std ;const double RATE = 150.00; //每刻钟收费的金额double fee(int hours_worked , int minutes_w原创 2012-06-02 15:42:40 · 299 阅读 · 0 评论 -
page148
// page148.cpp : 定义控制台应用程序的入口点。//C++面向对象程序设计//计算绿秃鹰产卵总数//由保护区的所有动物保护着统计#include "stdafx.h"#include using namespace std ;int get_one_total();//前条件:用户输入一系列鸡蛋数量//最后以一个负数结束//后条件:总数等于所有原创 2012-06-01 12:30:14 · 305 阅读 · 0 评论