当前位置:首页 > 搜索 "程序填空题"
程序填空题:求二维数组中奇数元素之和
下面这段程序是计算并打印一个二维数组(数组的数组)中值为奇数的元素之和。题目保证输入的元素均为绝对值不超过10000的整数。请填写空缺的代码。```c#include int sumOdd(int (*array)[5], int row)…
程序填空题:求整数各位数字之和
下面这段程序打印输入的整数num的各位数字之和(例如,输入123,则打印6;输入-12则打印3)。请填写空缺的代码。```c#include int main(){ int num; scanf("%d", &num);……
程序填空题:求整数最高位数字
下面这段程序打印输入的整数num的最高位数字(例如,输入`321`,则打印`3`;输入`-678`,则打印`6`)。请填写空缺的代码。```c#include int main(){ int num; scanf("%d", &……
程序填空题:找数组最大值
以下程序是通过调用函数findmax,找出数组中的最大值。请填空,实现程序的查找功能。```c++#include #define SIZE 10void findmax( int *px,int n,int *pmax );int mai…
程序填空题:对10个整数按照从小到大进行排序
对10个整数按照从小到大进行排序。```c++ #include int main() { int a[10],i,j,min,t; for (i=0;i˂10;i++)……
程序填空题:求出数组两条对角线上各元素之和
求出数组两条对角线上各元素之和。```c++#include int main(){ int a[3][3]={1,2,3,4,5,6,7,8,9}; int sum1=0,sum2=0,k,i,j; for(k=0;k˂3;k++)……
程序填空题:Insert an element into a min heap (No sentinel)
The program below contains a function `insertIntoHeap( )` which inserts an element into a min heap/priority queue(最小堆).F…
程序填空题:Delete the minimum value from a min heap
The program below contains a function `deleteMin( )` which get and removes the minimum value from a min heap/priority q……
程序填空题:单链表逆转(不带有头节点)
以下这段程序将单链表逆转。(单链表不带有空头结点,链表头指针是`head`)例如,链表 1 -˃ 2 -˃ 3 -˃ 4 逆转后变为 4 -˃ 3 -˃ 2 -˃ 1 .```c#include #include struct Node{……
程序填空题:Insert a node into a linked list
The program below contains the **finding** and **inserting** operations of the Linked List **without** dummy head node.T…
程序填空题:Delete a node from a linked list
The program below contains the **finding** and **deleting** operations of the Linked List **without** dummy head node.Th…
程序填空题:Triangle area_1
The function of this program is to calculate triangle area from inputed 3 sides. The question guaranteed the 3 sides wil…
程序填空题:对象数组
将空白的地方填写完整,使程序完成指定的功能。```c++#include using namespace std;class Student {public: @@[Student(int n,float s):num(n),score……
程序填空题:尾插法建立链表
使用尾插法建立带头节点的单链表。```c++#include #include typedef int ElemType;typedef struct LNode{ ElemType data; struct LNode *next;}LN…
程序填空题:显式使用this指针
填写程序中的空白,完成指定的功能。```c++#includeusing namespace std;class R{ int len,w;public: R(int len,int w); int getArea();}……
程序填空题:对象的动态创建
填充程序空白,完成指定的输出。```c++using namespace std;class A{ int i;public: A(int k=0){ i=k; } void display(){……
程序填空题:静态数据成员
填写程序中的空白,完成指定的功能```c++#includeusing namespace std;class Point{ double x,y; @@[static int cnt;](2)//定义静态变量public:……
程序填空题:输出整数x的绝对值,不能使用库函数
输入一个整数,根据输入,输出该整数的绝对值。限定不能调用库函数。。```#include int main(void){int x; @@[scanf("%d",&x)](4); if(x˃=0) @@[printf("%d\n",x)……
程序填空题:点类的定义和使用
已知平面上的一点由其横纵坐标来标识。本题要求按照已给代码和注释完成一个基本的“点”类的定义(坐标均取整型数值)。并通过主函数中的点类对象完成一些简单操作,分析程序运行结果,将答案写在对应的空格中。```c++#include using n…
程序填空题:判断一个5位数是否是回文
回文数是指正读和反读都一样的数。例如:12321、55455、35553等都是回文。请编写一个程序,从键盘上读取一个包含5位数字的长整数,并判断它是否是回文数。先将输入数据输出,再输出是否是回文,若是回文输出“yes”,否则输出“no",中…