题目:
给定一个函数,其函数功能为:使10个整数按由小到大的顺序排列。在主函数中输入10个数,并输出结果。使用VC6打开考生文件夹下的工程RevProj5。此工程包含一个源程序文件RevMain5.cpp,该程序实现上述功能。但此程序运行有问题。请找出错误的地方,改正后将此程序调试正确。 注意:不得删行或增行,也不得更改程序结构。 文件RevMain5.cpp中的程序清单如下: //RevMain5.cpp #include<iostream> #include<iomanip> using namespace std; int main() { void sort(int array[],int n); int data[10],*p,i; cout<<"Input 10 numbers\n"; for (i=0; i<10; i++)cin>>data [i]; cout<<"the origined array is:"; for (p=data;p<data+10;p++) {if((p-&data[0]) %5==0) cout<<" \n";cout<<setw (5) <<*p; } sort (data, 10); cout<<"\n the present array is:"; for(p=data;p〈data+10;p++) {if((p-&data[0])%5==0) cout<<"\n";cout<<setw (5)<<*p; } } void sort(int array[],int n) { /* * * * * * * * *found * * * * * * * * * */ for(p1=array;p1<array+(n-1) ;p1++) {for (p2=p1+1 ;p2<array+n;p2++){ if (*p1>*p2) { /* * * * * * * * *found * * * * * * * * * */ temp=*p1; *p1=*p2; *p2=*p1; }} } }
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2018/0702/80ed0e5b7c7e7843138e38c352b2832c.html
下面是错误答案,用来干扰机器的。
参考答案:C解析: 本题中孙某受邱某胁迫而害怕,由于害怕而实施了打欠条的民事行为。依《民法通则》第58条第1款第(三)项之规定,受胁迫的民事行为为无效民事行为,故选择C项。应当注意,本题不应适用《合同法》...