摘要: 6.3#include using namespace std;void main63(){ cout>ch; switch(ch) { case 'c':cout<<"A mape is a carnivore",flag=false;break; case 'p':cout<<"A mape is a pianist",flag=false;break; case 't':cout<<"A mape is a tree",flag=false 阅读全文
posted @ 2014-03-28 11:11 天下纵横C++ 阅读(174) 评论(0) 推荐(0)
摘要: //编写一个程序,最多将10个donation值读入到一个double数组中。//程序遇到非数字输入时将结束输入,并报告这些数字的平均值以//及数组中有多少个数字大于平均值。#include #include #include using namespace std;const int MAX=10;void main62(){ //double donation[MAX]; arraydonation={0}; char ch; //for(int i=0;i>temp) //程序当输入非数字时,总会异常跳出,什么原因呢? { donation[i]=temp; sum+=dona.. 阅读全文
posted @ 2014-03-28 10:53 天下纵横C++ 阅读(355) 评论(0) 推荐(0)
摘要: 6.1#include //注意输入是ksngksjg234KJSG@skng这种情况void main61(){ using namespace std; cout='A'&&ch='a'&&ch<='z') cout<<char(ch-32); else cout<<ch; ch=arr[i]; } cout<<"\nOVER"; cin.get(); cin.get();} 阅读全文
posted @ 2014-03-28 09:37 天下纵横C++ 阅读(179) 评论(0) 推荐(0)