摘要:
8.4这道题有个BUG,我暂时还是无法解决,谁解决的麻烦告诉下我#include#include //出问题时,使用的是cstring,但换成string一样出问题using namespace std;struct stringy{ char *str; int ct;};void set(stringy &beany,const char t[]);void show(const stringy &beany,int count=0);void show(const char t[],int count=0);void main84(){ stringy beany; // 阅读全文
posted @ 2014-04-10 16:17
天下纵横C++
阅读(1216)
评论(0)
推荐(0)
摘要:
8.3#include #include #includeusing namespace std;const int MAX=50;void change(string &s);void main83(){ string s="chenggSHIguang"; //char ch='\0'; change(s); while(s!="q"&&(s.length()!=1)) { cout#include //出问题时,使用的是cstring,但换成string一样出问题using namespace std;str 阅读全文
posted @ 2014-04-10 14:48
天下纵横C++
阅读(196)
评论(0)
推荐(0)
摘要:
8.2#include #include using namespace std;struct CandyBar{ char *name; double weight; int kaluli;};void set(CandyBar &cb,char *name="Millennium Munch",double weight=2.85,int kaluli=350);//默认初始化void show(const CandyBar &cb);void main82(){ CandyBar c1,c2; set(c1,"DEFU",20.5, 阅读全文
posted @ 2014-04-10 14:04
天下纵横C++
阅读(248)
评论(0)
推荐(0)
摘要:
8.1#include #include using std::cout;using std::cin;using std::endl;using std::string ;void print(const string &s,int count=0);static int number=0;//记录被调用的次数void main81(){ print("I love you"); print("Can you"); print("haha",100); print("I love you"); print 阅读全文
posted @ 2014-04-10 13:46
天下纵横C++
阅读(250)
评论(0)
推荐(0)
摘要:
7.10#include using namespace std;double add(double a,double b){return a+b;};//为了简化,这三个函数我直接在这里写了。double dev(double a,double b){return a-b;};double mul(double a,double b){return a*b;};double calculate(double a,double b,double (*pf[])(double x,double y));void main710(){ double (*pf[3])(double,double)= 阅读全文
posted @ 2014-04-10 13:23
天下纵横C++
阅读(218)
评论(0)
推荐(0)
摘要:
来试试这个功能 阅读全文
posted @ 2014-04-10 12:34
天下纵横C++
阅读(115)
评论(0)
推荐(0)
摘要:
7.9#include using namespace std;const int SLEN=30;struct student{ char fullname[SLEN]; char hobby[SLEN]; int ooplevel;};int getinfo(student pa[],int n);void display1(student st);void display2(const student *ps);void display3(const student pa[],int n);void main79(){ cout>class_size; while(cin.get( 阅读全文
posted @ 2014-04-10 12:27
天下纵横C++
阅读(362)
评论(0)
推荐(0)
摘要:
哈哈,还以为CSDN基本没人评论呢,没想到还是会有人评论的啊。虽然说是转载的文章,哈哈哈,小小的开心了一把。 阅读全文
posted @ 2014-04-10 12:07
天下纵横C++
阅读(102)
评论(0)
推荐(0)
摘要:
7.8bvs2010不知道搞毛,居然爆了一推出错。但是在Dev c++运行完成没问题,暂时还不知道为什么。已经搞清楚了错误所在。原因是:std名称空间已经有了exp这个关键词的存在!将exp改为Exp或者using namespace std改为using std::cout;using std::cin;#include using namespace std;const int Seasons=4;const char *season[Seasons]={"Spring","Summer","Fall","Winter& 阅读全文
posted @ 2014-04-10 10:47
天下纵横C++
阅读(165)
评论(0)
推荐(0)
摘要:
程序都是我在VS2010 win7 32bit情况下编译完成的。程序都是没有问题,都是我自己亲测过后可行我才发上来的。因为效率问题,题目我就无法一一发上去了。对于一些不友好的输入,程序可能会出错。说明就到这里吧。 阅读全文
posted @ 2014-04-10 10:31
天下纵横C++
阅读(186)
评论(0)
推荐(0)

浙公网安备 33010602011771号