摘要:
题目描述: 定义一个结构体,成员包括:学号,姓名,性别,出生日期,成绩,住址,电话。 要求输入5个学生的信息,并输出。 include using namespace std; struct student{ int num; char name[10]; char sex[10]; char bi 阅读全文
posted @ 2019-04-14 22:34
izzwhf
阅读(216)
评论(0)
推荐(0)
摘要:
题目描述: 编写一个基于面向对象的程序,求数组的最大值,并对数组进行排序。 (要求在类外定义函数成员) include include include using namespace std; class array{ private: int a[10]; public: void set_arr 阅读全文
posted @ 2019-04-14 22:28
izzwhf
阅读(363)
评论(0)
推荐(0)
摘要:
题目描述: 声明10个元素的整型数组 (1)给数组元素赋值(两位随机整数) (2)输出该数组的元素 用冒泡法升序排序并输出 用选择法降序排序并输出 include include include int main(void){ int a[10]; int i,j; srand(time(NULL) 阅读全文
posted @ 2019-04-14 22:26
izzwhf
阅读(123)
评论(0)
推荐(0)
摘要:
题目描述: 声明一个10个元素的整型数组(用随机函数赋值), 用选择法对数组进行排序,要求用函数完成 include include include void sort(int a[],int n){ int i,j,max,max_k,temp; for(i=0;imax){ max=a[j]; 阅读全文
posted @ 2019-04-14 22:22
izzwhf
阅读(121)
评论(0)
推荐(0)
摘要:
题目描述: 声明一个5行5列的二维数组,用随机函数给数组赋值(3位整数) (1)输出该二维数组 (2)求二维数组元素的最大值 (3)求主对角线元素之和,次对角线元素之和 include include include int main(void){ int i,j,a[5][5],max,sum1= 阅读全文
posted @ 2019-04-14 22:19
izzwhf
阅读(255)
评论(0)
推荐(0)
摘要:
题目描述: 用递归方法求f(n)=累加i^2,(i=1~n) include double fac(int n){ double s; if(n==1) s=1; else s=fac(n 1)+n n; return s; } int main(void){ int n,s; std::cout 阅读全文
posted @ 2019-04-14 22:15
izzwhf
阅读(747)
评论(0)
推荐(0)
摘要:
题目描述: 求a!+b!+c!的值,用一个函数fac(n)求n!。 a,b,c的值由主函数输入,最终得到的值在主函数中输出 include double fac(int n){ if(n==1){ return 1; } else return n fac(n 1); } int main(void 阅读全文
posted @ 2019-04-14 22:12
izzwhf
阅读(317)
评论(0)
推荐(0)
摘要:
题目描述: 用while语句求1!+2!+3!+...+10! include include using namespace std; int main(void){ int a=1,i=1,sum=0; while(i 阅读全文
posted @ 2019-04-14 22:12
izzwhf
阅读(1375)
评论(0)
推荐(0)
摘要:
题目描述: 声明10个元素的整型数组 (1)给数组元素赋值(两位随机整数) (2)输出该数组的元素 (3)求数组元素的最大值,最小值并输出 (4)求数组元素的总和,平均值并输出 include include include int main(void){ int a[10]; int i; sra 阅读全文
posted @ 2019-04-14 22:12
izzwhf
阅读(1348)
评论(0)
推荐(0)
摘要:
题目描述: 创建双向链表类,该类有默认构造函数、类的拷贝函数、类的析构函数、实现链表添加数据、升序排序、查找链表中某个节点及删除链表中某个节点的操作(禁用STL及String类))。 “dLinkList.h” "dLinkList.cpp" include"pch.h" include"dLink 阅读全文
posted @ 2019-04-14 21:42
izzwhf
阅读(580)
评论(0)
推荐(0)

浙公网安备 33010602011771号