问答题
【参考答案】
①classCircle:public Point
②Circle(int a,int b,int......
(↓↓↓ 点击下方‘点击查看答案’看完整答案、解析 ↓↓↓)
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
问答题
请编写一个函数void fun(int p[],int n,int c),其中数组p的元素按由小到大的顺序排列,其元素个数为n。函数fun()的功能是将c插入到数组p中,且保持数组的升序排列。 注意:部分源程序已存在文件PROC9.cpp中。 请勿修改主函数和其他函数中的任何内容,仅在函数fun()的花括号中填写若干语句; 文件PROC9.cpp的内容如下: PROC9.cpp #include <iostream> #include <string> using namespace std; #define M 30 void fun(int p[ ],int n,int c); int main () int pp[M],n,i; int fg, c; cout<< Please input n: n ; cin>>n; cout<< Please input the n data: n ; for (i=0; i<n; i++) cin>>pp [i]; cout<< Please input c: n ; cin>>c; fun (pp, n, c); for (i=0; i<n; i++) cout<<pp [i] << ; cout<<end1; return 0; void fun(int p[ ],int n, int c) * * * * * * * * *
点击查看答案&解析
问答题
使用VC6打开考生文件夹下的工程RevProj9。此工程包含一个源程序文件RevMain9.cpp。在该文件中,函数fun()的功能是;将字符串s中的小写字母都改为对应的大写字母,其他字符不变。例如,输入“mT+gN”,则输出“MT+GN”。 请改正程序中的错误,使它能得到正确结果。 注意,不要改动main函数,不得删行或增行,也不得更改程序的结构。 源程序文件RevMain9.cpp中的程序清单如下; RevMain9.cpp #include<iostream> using namespace std; char* fun(char*s); int main() int i; char str[81]; cout<< Please enter a string: ; cin>>str; cout<< n The result is: n <<fun(str)<<end1; return 0; char *fun(char*s) int i; for(i=0;s[i];i++) * * * * *FOUND* * * * * if((’a’<=s[i])||(s[i]<:=’z’)) * * * * *FOUND * * * * * s[i]+=32; return s;
点击查看答案&解析
相关试题
请编写一个函数void fun(int p[],int...
使用VC6打开考生文件夹下的工程RevProj9...