- 博客(28)
- 收藏
- 关注
原创 吉林大学软件工程机器学习期末复习指南
选择10道:很简单的选择,没咋学过的都应该会吧,好多都是给你3个很离谱的选项一眼就看出来正错的(还考了一道dropout作用(防止过拟合)的题,我们班好像是没讲的,但因为他给的其他选项太离谱,因此很简单)k-means给了具体的几个点(1,1)(2,2)(3,3)(8,8)(9,9),k=2,初始点为(1,1)(9,9),让你写分类的过程和最后分类完成的聚类中心。给你了5个具体的二维样本点(x1,x2)和他的输出y,让你用批量梯度下降(BGD)的线性回归去迭代一次的过程。纯作文题,应该是老师捞人的好手段。
2025-04-03 18:31:16
260
原创 吉林大学软件工程期末考试
总结:考的时候前面感觉挺简单的,后面这俩大题还是有点麻烦。我的复习路线是跟着书把PPT过了一遍,然后做学习通的题再过一遍,奔腾的历年题就做了两套,因为没答案,找同学对了对,差不多就这样。真是有点逆天,都是让你自己去画,一道中文描述的作业批改系统,画数据流图;一道英文阅读,画用例图和类图,关于什么诊所吧,这道我不太会,乱画的。刚考完,22软件这次的题有点搞笑,考上英文了。如果有需要我使用到的复习资源,可以私信我,我看到的话会回复。还有Artifacts,好像是RUP的,没一个人会。全是英文名词,这次考了。
2025-04-03 18:30:14
78
原创 构造函数的分类及调用
#include<iostream>#include<string>using namespace std;//构造函数的分类及调用//按照参数 有参和无参//按照类型分类 普通构造 和 拷贝构造class person{public: person()//无参构造函数 { cout << "person的构造函数调用" << endl; } person(int a)//有参构造函数 { cout << "pe.
2022-04-06 13:25:00
616
原创 点和圆的关系案例
#include<iostream>#include<string>using namespace std;#include"circle.h"#include"point.h"//class point//{//public:// void setx(int x)// {// m_x = x;// }// void sety(int y)// {// m_y =y ;// }// int getx()// {// return m_x ;.
2022-04-05 19:44:41
243
原创 设计一个立方体类(封装)
#include<iostream>#include<string>using namespace std;//设计立方体类//求出立方体的面积和体积//分别用全局函数和成员函数判断两个立方体是否相等class cube{ //行为(获取长宽高)(立方体的面积)(体积) //属性public: //设置长 void setl(int l) { m_l = l; } int getl() { return m_l; } void setw(.
2022-04-05 16:50:08
170
原创 成员属性私有化
#include<iostream>#include<string>using namespace std;//成员属性设置为私有class person{public: void setname(string name) { m_name = name; } string getname() { return m_name; } int age() { m_age = 0; return m_age; } void setlover.
2022-04-05 13:08:12
96
原创 struct 和 class 的区别
#include<iostream>#include<string>using namespace std;//struct 和 class的区别:默认权限的不同class c1{ int m_a;//默认权限 是私有};struct c2{ int m_a;//默认权限 是公共};int main(){ c1 cc1;// cc1.m_a;//error 私有权限不可以被访问 c2 cc2;//可以被访问,struct 可以被访问 system.
2022-04-05 12:53:48
73
原创 三种权限访问
#include<iostream>#include<string>using namespace std;//访问权限总共有三种//公共权限 public 成员类内可以访问 类外可以访问//保护权限 protected 类内可以访问 类外不可以访问//私有权限 private 类内可以 类外不可以class person{public://公关权限 string m_name;protected://保护权限 string m_car;p.
2022-04-05 12:49:27
267
原创 类和对象(c++核心)
c++面向对象的三大特性:封装,继承,多态c++认为万事万物都有对象,对象上有其属性和行为具有相同性质的对象,我们抽象为一个类一、封装将属性和行为作为一个整体,表现生活中的事物将属性和行为加以权限控制设计了一个类:class#include<iostream>using namespace std;const double PI = 3.1415926;//设计一个圆类,求圆的周长//class代表设计一个类,类后面紧跟着的就是类名称class circl
2022-04-04 22:38:37
628
原创 函数重载(函数名字可以相同)
#include<iostream>using namespace std;//函数重载 //作用:函数名可以相同,提高复用性//函数重载的满足条件//1.同一个作用域下(全局作用域)//2.函数名称相同//3.函数参数的类型不同,或者个数不同,或者顺序不同void func(){ cout << "func的调用" << endl;}//int func()//{// cout << "func的调用" << end.
2022-04-04 22:00:09
1412
原创 站位参数的使用(后面会有用)
#include<iostream>using namespace std;//返回值类型 函数名(数据类型){}//目前阶段的站位参数,后面会用到//站位参数 还可以有默认参数void func(int a,int)//站位参数{ cout << "this is a func" << endl;}int main(){ func(10,10); system("pause"); return 0;}...
2022-04-04 21:49:07
305
原创 函数的默认参数
#include<iostream>using namespace std;//函数的默认参数//如果我们自己传入了数据,就用自己的数据,如果没有就用默认值//语法:返回值类型 函数名(形参=默认值)int func(int a, int b=20, int c=30){ return a + b + c;}//注意事项//1.如果某个位置已经有了默认参数,那么从这个位置开始,从左到右都必须有默认值//int func2(int a, int b=10, int c)//.
2022-04-04 21:43:21
350
原创 引用:给变量起别名(本质->指针常量)
#include<iostream>using namespace std;//引用:给变量起别名int main() { int b=0; int& a = b; a = 10; cout <<"b="<< b << endl; cout <<"a="<< a << endl; b = 10000; cout << "b=" << b << endl; .
2022-04-04 13:45:46
122
原创 new,delete关键字
#include<iostream>using namespace std;int * func(){ int * p=new int(10); return p;}void test02()//开辟数组{ int * arr=new int[10]; for (int i = 0; i < 10; i++) { arr[i] = i + 100; } for (int j = 0; j < 10; j++) { cout << ar.
2022-04-04 13:04:51
128
原创 全局区(变量和常量)栈区、堆区
栈区的数据由编译器管理,不要返回局部变量的地址堆区的空间由程序员释放,程序结束后由操作系统释放#include<iostream>using namespace std;int* func(){ //利用new关键字 可以将数据开辟到堆区 //指针变量是在栈上的,本质也是局部变量 int * p=new int(10); return p;}int main() { int * p = func(); cout << *p << e..
2022-04-03 22:51:14
657
原创 c++关于对数组冒泡排序
#include<iostream>using namespace std;void bubblesort(int *arr,int len){ for (int i = 0; i < len - 1; i++) { for (int j=0; j < len - i - 1; j++) { if (arr[j] > arr[j + 1]) { int t = arr[j]; arr[j] = arr[j + 1]; ar.
2022-04-03 15:40:36
765
原创 指针常量const
1.const修饰的是指针,指针指向可以改,指针指向的值不能改const int *p1=&a;2.const修饰的是常量,指针指向不可以改,指针指向的值可以改int * const p2=&a3.const既修饰指针又修饰常量const int * const p3=&a...
2022-04-03 11:26:57
218
原创 位运算符c语言
#include<stdio.h>//位运算符可以对数据的操作精确到每一位int main(void){ int i = 5;//0101 int j = 7;//0111 int k; k = i & j;//按位与& 二进制每一位比较真假 //1&1=1 0&0=0 1&0=0 printf("%d\n", k); k = i && j;// 逻辑运算符 printf("%d\n", k); k = i |.
2022-04-01 13:24:43
239
原创 链表遍历示意图
#include<stdio.h>//链表遍历示意图#include<malloc.h>#include<stdbool.h>struct node{ int data; struct node * pnext;};//链表struct node *creatlist();void traverselist();bool emptylist(struct node* phead){ if (phead->pnext == NULL) r.
2022-03-31 23:33:44
294
原创 enum枚举
#include<stdio.h>enum weekday//定义了一个数据类型,并没有定义变量 { Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday};int main(void){ enum weekday day = Wednesday; printf("%d\n", day); return 0;}
2022-03-30 21:46:06
215
原创 动态构造存放学生管理系统
#include<stdio.h>//动态构造存放学生管理系统#include<malloc.h>struct student{ int age; float score; char name[100];};int main(void){ int len; int i,j; struct student t; struct student *parr; printf("请输入学生的人数:\n"); printf("len="); scanf("%d.
2022-03-30 18:59:22
250
原创 冒泡排序c
#include<stdio.h>void sort(int * a,int len){ int i, j, t; for (i = 0; i < len - 1; ++i) { for (j = 0; j < len - 1 - i; ++j) { if (a[j] > a[j + 1]) { t = a[j]; a[j] = a[j + 1]; a[j + 1] = t; } } }}int mai.
2022-03-30 17:57:59
237
原创 结构体变量
#include<stdio.h>#include<string.h>struct student//结构体变量不能相加,相乘,相除{ int age; char sex; char name[100];};void inputstudent(struct student *);void outputstudent(const struct student *);int main(void){ struct student x;...
2022-03-30 16:31:35
319
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人