- 博客(20)
- 资源 (11)
- 收藏
- 关注
原创 实验五、多层感知机的实现
第1关实现全连接层的前向传播importnumpyasnpclassFullyConnected:def__init__(self,W,b):r'''全连接层的初始化。Parameter:-W:numpy.array,(D_in,D_out)-b:numpy.array,(D_out)'''self.W=...
2022-04-15 10:49:33
1052
原创 设计并实现注册登录,要求实现以下功能1.构建一个功能全面、界面美观的注册界面;2.能够实现多选框单选框的应用;3.能够实现注册成功的提示等。
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:background="@drawable/mn" android:layout_width="match_parent" android:layout_height="match_parent" android...
2021-11-16 21:47:46
278
原创 BMI指数(Body Mass Index身体质量指数),简称体质指数又称体重指数,BMI值是根据你的身高、体重按照一定的公式得出数值,是一个衡量你身体健康的参数。
<?xml version="1.0" encoding="utf-8"?><!--添加布局属性--><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"...
2021-11-16 21:44:55
4757
原创 Java 同一对象被多个变量引用
对象创建与使用掌握如何创建类的对象掌握如何使用两个或者多个变量引用同一个实例对象public class Example01 { public static void main(String []args){ Student s1=new Student (); s1.name="张三"; s1.age=19; s1.speak(); Student s2=new Student (); s2...
2021-11-16 21:33:36
1583
原创 Java 面向对象中类的定义
掌握类定义的方式 掌握如何在类中定义成员变量和成员方法 public class Student { public String name; public int age; void speak() { System.out.println("我是" + name + ",今年" + age + "岁。"); } } public class Test { private static Object st1; ...
2021-11-16 21:30:18
439
原创 c++定义一个浮点数组,含20个元素从键盘输入20个数值,求出最大值与最小值,从大到小输出数值
#include<iostream>#include <fstream>#include<string>using namespace std;int main(){ float a[20],max,min,t; int i,order; ofstream outfile("ab.txt",ios::out); if(!outfile){ cerr<<"open order!"<<...
2021-11-07 19:45:26
4483
原创 .输入任意字符串,以”/”结束输入(getline函数),将字符串中前5个字符写入文件中,并输出
#include<iostream>#include<fstream>using namespace std;int main(){char array[20];ofstream of("ccc.txt",ios::out);if(!of){ cout<<"打开文件失败\n"; exit(0);}cin.getline(array,15,'/');of.write(array,5);of.close();return 0;}...
2021-10-27 09:11:01
285
原创 C++单目运算符重载++(后置)
#include <iostream>using namespace std;class complex{public: complex(double x = 0, double y = 0):real(x), image(y) {} void display() { cout << "(" << this->real<< "," << this->image <...
2021-10-13 11:07:46
265
原创 C++1. 定义运算符重载函数,实现两个对象相减
#include<iostream>using namespace std;class si{ public: si() {age=33; score=55;}friend int operator+(si& aa,si& ac);private: int age; float score;};int operator+(si& aa,si& ac){ return(...
2021-10-13 11:03:24
564
原创 python编写改撒密码
import stringdef kaisa_jiami(w,d): lower=string.ascii_lowercase upper=string.ascii_uppercase before=string.ascii_letters after=lower[d:]+lower[:d]+upper[d:]+upper[:d] table=''.maketrans(before,after) return w.translate(table)def ...
2021-07-27 11:13:10
245
原创 python随机生成十个数
import randoma = range(3,100,2)b = random.sample(a, 10)print(b)x=0for i in b: x += 1print("整数的个数为:{:.0f}".format(x))
2021-07-24 16:29:36
3302
原创 python水仙花数
list=[]for i in range(1000,10000): str1=str(i) sum=0 for j in str1: num=int(j) sum=num**4 if i==sum: list.append(i) print(list)
2021-07-24 16:28:44
52
原创 用python语言编写七段数码管
import turtledef drawLine(draw): turtle.pendown() if draw else turtle.penup() turtle.fd(40) turtle.right(90)def drawDigit(digit): drawLine(True) if digit in [2,3,4,5,6,8,9] else drawLine(False) drawLine(True) if digit in [0,1,3,4,5,6,...
2021-07-24 16:27:48
630
原创 斐波那锲数列
def f(n): if n==1 or n==2: return 1 else: return f(n-1)+f(n-2)for i in range(20): print(format(f(i+1),'>10.0f'),end='') if(i+1)%10==0: print()
2021-07-24 16:26:06
90
原创 使用python语言进行温度转换
TempStar = input("请输入带有符号的温度值:")if TempStar[-1] in['F','f']: C=(eval(TempStar[0:-1]) - 32)/1.8 print("转换后的温度是{:.2f}C".format(C))elif TempStar[-1] in['C','c']: F=1.8*eval(TempStar[0:-1])+32 print("转换后的温度是{:.2}F".format(F))...
2021-07-24 11:58:44
129
原创 使用python语言编写出学生成绩排序
student_list = [88,99,100,55,14,55,33,3]lianghao=0jige=0youxiu=0bujige=0for i in student_list: if i>90: youxiu=youxiu+1 if i>80: lianghao=lianghao+1 if i>60: jige=jige+1 if i<60: ...
2021-07-24 11:55:57
5473
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人