java第一次作业

德国冯哈勃 Faulhaber2342L012空心杯减速电机带编码器 为了制作平衡车,我在淘宝上面买了一个 Faulhaber2342L012空心杯减速电机电机,具体参数如下: 一:电机参数 型    号:德国冯哈勃Faulhaber带编码器空心杯减速电机2342L012  12V每分 钟 120转 工作电压: 12V 空载转速:8100RPM(转每分钟) 减速后速:120RPM(转每分钟) 直     径:30mm 阅读详情

1. 输出"Hello World!" 不包含双引号(")

public class Main { 
        public static void main(String args[]){
                System.out.println("Hello World!");
        }
}

2.
京大学计算中心的英文缩写是PKUCC,下面是用ASCII ART输出的图形,请写一段代码输出它。
########  ##    ## ##     ##  ######   ######
##     ## ##   ##  ##     ## ##    ## ##    ##
##     ## ##  ##   ##     ## ##       ##
########  #####    ##     ## ##       ##
##        ##  ##   ##     ## ##       ##
##        ##   ##  ##     ## ##    ## ##    ##
##        ##    ##  #######   ######   ######
public class Main {  
    public static void main(String[] args) {  
          System.out.println("########  ##    ## ##     ##  ######   ######");  
          System.out.println("##     ## ##   ##  ##     ## ##    ## ##    ##");  
          System.out.println("##     ## ##  ##   ##     ## ##       ##");  
          System.out.println("########  #####    ##     ## ##       ##");  
          System.out.println("##        ##  ##   ##     ## ##       ##");  
          System.out.println("##        ##   ##  ##     ## ##    ## ##    ##");  
          System.out.println("##        ##    ##  #######   ######   ######");  
    }  
} 

3.题目描述:
计算 a + b 的值
输入:
两个整数 a,b (0 ≤ a,b ≤ 10)
输出:
计算 a + b 的结果

在老师网站能通过编译的:

import java.io.*;  
import java.util.*;  
public class Main {  
            public static void main(String args[]) throws Exception {  
                    Scanner cin=new Scanner(System.in);  
                    int a=cin.nextInt(),b=cin.nextInt();  
                    System.out.println(a+b);  
            }  
}   

自己做的:

import java.util.InputMismatchException; 
import java.util.Scanner; 
public class Main { 
 public static void main(String[] args) { 
       Scanner sin = new Scanner(System.in); 
      int first = 0, second = 0; 
     try { 
          System.out.print("请输入第一个>=0的整数:"); 
          first = sin.nextInt(); 
         System.out.print("请输入第二个<=10的整数:"); 
         second = sin.nextInt(); 
            if (first < 0 || second > 10) { 
              System.out.println("数据输入错误!"); 
         } else { 
               System.out.println(first + "+" + second + "=" + (first + second)); 
         } 
      } catch (InputMismatchException e) { 
           System.out.println("错误!请输入整数"); 
        } 
  } 
}   

OpenBCI脑电实验避坑指南:如何用Python准确捕捉P300信号 本文详细介绍了使用OpenBCI和Python进行P300脑电信号实验的避坑指南,包括电极贴放、信号采集、信号处理和数据分析等关键步骤。通过实战经验和代码示例,帮助研究者避开常见陷阱,提高P300信号捕捉的准确率,适用于脑机接口和神经科学研究。 阅读详情

相关推荐

GLDAS数据高效处理指南:基于Matlab的NC4转GeoTIFF实战解析

本文提供了一份基于Matlab的GLDAS数据处理实战指南,详细解析了如何将NetCDF4格式的GLDAS数据高效、准确地批量转换为GIS友好的GeoTIFF格式。文章核心内容包括数据理解、环境搭建、核心代码逐步拆解、效率提升技巧以及常见避坑方案,旨在帮助全球生态、水文与气候领域的研究者打通数据预处理的关键环节,提升科研工作效率。

weixin_29094775的博客 311

java 程序设计第一次作业

public class Join{ public static void main(String args[]){ String s1=new String("hello"); String s2=new String("word"); String s=s1+" "+s2; ...

dboggj4184的博客 299

ENVI遥感技术

记录2024.03.06所遇到的遥感问题

qq_44453923的博客 4332

我的第二个Java作业

1.简述Java中变量的命名规则。 答: 1.变量名必须是以字母、数字、下划线或$组成。 2.变量名不能以数字开头。 3.变量名不能是Java关键字。 4.除了下划线、$之外,不包括任何其他特殊字符。 2.举例说明做什么情况下会发生自动类型转换。 答:字节数少的数据类型会自动转换为...

weixin_43024812的博客 461

STM32低功耗模式下ADC采样抖动的5个隐藏陷阱及解决方案(实测避坑)

本文深入探讨了STM32低功耗模式下ADC采样抖动的5个常见陷阱及解决方案,包括多通道采样电压跃迁、外设开关信号稳定、低功耗模式与ADC时钟同步、输入阻抗失配以及基准电压稳定性问题。通过实测数据和优化代码示例,帮助工程师有效规避ADC采样数据抖动问题,提升物联网设备的测量精度和稳定性。

weixin_30316097的博客 381

win10离线安装.NetFrameWork3.5出现0x800F081F解决办法。

由于公司开发环境是内网,并且安装arcgis10.2又需要.NetFrameWork3.5的环境,安装.NetFrameWork3.5的又总是报错“0x800F081F”找不到源文件。折腾了两天总算解决了。 首先我们能在网上搜索到的教程,你一定看到过这样的教程,就是使用下面的命令来进行安装。 dism /online /Enable-Feature /Featu...

AIGIS的博客 1万+

java第二次上机作业

P130,4.16package gsn; publicclass sdfg {     publicstaticvoid main(String[] args) {        // TODO Auto-generated method stub        //int number=new int;        int number = (int)(Math.random()*26)+6...

nashty0214的博客 587

【实战分享】低成本K型热电偶测温方案:单运放放大与STM32 ADC采集优化

本文详细介绍了低成本K型热电偶测温方案,通过单运放放大与STM32 ADC采集优化,解决了信号微弱、负电压处理和冷端补偿等核心挑战。方案采用LMV358运放和T型网络降低噪声,结合STM32的ADC校准和软件滤波,实现±0.5℃精度,物料成本控制在15元以内,适用于工业测温场景。

weixin_30839881的博客 168

SDN 第二次上机作业

SDN第二次上机作业 1、控制器floodlight所示可视化图形拓扑的截图,及主机拓扑连通性检测截图 拓扑 连通性 2、利用字符界面下发流表,使得‘h1’和‘h2’ ping 不通 流表截图 连通性 3、利用字符界面下发流表,通过测试‘h1’和‘h3’的联通性,来验证openflow的hardtime机制 初始连通性 下发具有hardtime的流表 测试结果 转载于:...

baiwanmei0622的博客 355

Carla运行显示The following component(s) are required to run this program:DirectX Runtime |nvapi64.dll没有被

Carla运行显示The following component(s) are required to run this p 参考: 【1】EPIC 启动游戏提示The following component(s) are required to run this program:... - 『悬赏问答区』 - 吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cnhttps://www.52pojie.cn/thread-1485651-1-1.html ...

anananajiushiwo的博客 5万+

YOLOv11涨点改进 | NeurIPS2025最佳论文!注意力改进篇| 引入Gated Attention门控注意力模块、太牛了!直接拯救了大模型的发展,助力目标检测、图像分割、图像分类有效涨点

本文提出了一种基于门控注意力机制(GatedAttention)的YOLOv11改进方法。该模块通过在标准注意力机制中引入头部特定的sigmoid门控,有效提升了模型性能和训练稳定性。实验表明,GatedAttention能够增强模型对关键信息的聚焦能力,减少无关区域关注,提高检测精度。同时,门控机制带来的非线性和稀疏性优化了计算效率,并缓解了训练不稳定性问题。文章详细介绍了模块原理、实现代码及三种改进方案配置方法,为YOLOv11在复杂场景下的目标检测提供了有效解决方案。

Ai缝合怪、助力小伙伴高效发论文 495

Java第一次作业(2)

2.打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数本身。例如:153 是一个"水仙花数",因为153=1的三次方+5的三次方+3的三次方。 public class shui { public static void main(String args[]) { int x,y,z,count; for(int max=100;max { x=(m

worm_1的博客 609

SOI LDMOS器件的Sentaurus TCAD建模与关键电学特性仿真研究

本文研究了SOI LDMOS器件的TCAD建模与电学特性仿真。通过Sentaurus TCAD平台建立了单RESURF结构的SOI LDMOS模型,详细阐述了器件结构原理和RESURF耐压机制。研究采用SDE进行几何定义和掺杂配置,在Sentaurus Device中构建了完整的物理模型体系,包括迁移率、复合和碰撞电离模型。通过系统仿真提取了器件的转移特性、输出特性和击穿特性等关键参数,分析了各参数对性能的影响规律。研究结果为功率半导体器件的仿真建模提供了规范化参考,有助于优化SOI LDMOS的性能设计。

huanghm88的专栏 134

第一次Java作业

长春地铁一号线轨道交通充值信息对联。

ywl20041008的博客 69

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

我的Java第一次作业

关于三个java的编写

ycq8888的博客 92

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

Java,第一次作业——货币兑换

题目: ( 金融:货币兑换)编写一个程序,提示用户输入从美元到人民币的兑换汇率。提示用 户输入 0 表示从美元兑换为人民币,输入 1 表示从人民币兑换为美元。继而提示用户输 入美元数量或者人民币数量,分别兑换为另外一种货币。下面是运行示例 class Tang_01_20 { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("Enter the e

weixin_52572455的博客 2141

Java程序设计第一次作业

这是第一次的Java作业,完成的过程有点困难,也去问了课代表同学,经过他的教导,终于成功的完成了。可能做得还不是很好,但是我也会更加努力的去学习这门课程,我相信只要我自己有足够的努力去学习这些,一定可以学得更好。 转载于:https://www.cnblogs.com/rfcd/p/10601502.html...

weixin_30753873的博客 98

java作业总结_java作业的第一次总结

1.前言针对我们第一阶段的作业(共三次:pta中的作业)发表总结性博客。2.作业过程总结作业练习心得总结:①第一周的作业我做起来感觉有点C语言的韵味,但是这应该就是一种过渡性的作业,让我们从C语言的思维过渡到Java面向对象的思维的铺垫。题目考查的内容包括:主要是考查if else的运用,还有就是了解了一些关于Java的输入和输出的方式,知道关于字符串获取字符的运用和动态数组的理解,了解了面向对象...

weixin_35433930的博客 616

Java第一次作业

/* * @(#)Card *  * Copyright 2008 School of Software, Yunnan University. *                                  All rights reserved */package cn.edu.ynu.sei.java_homework.HW1.Part1;/** * Java平时作业1,第一部分 *

Eleven's Blog 1148

java第一次作业_Java第一次作业

个人感觉Java的知识点很多,是C语言难以比的,所以应经常写Java程序熟练其知识点。但同时也应通过C语言与Java的相似处,在学习Java的时候模仿C;如有些简单的C语言代码,稍微做下修改,便可以在Java编译器上运行。因此如果对Java不太熟悉,碰到不会做的题目,可以先尝试下,通过C语言实现,再来做修改,使其变成Java程序。以下是我用dos命令完成的作业:以下是我通过模仿C语言,写好的Jav...

weixin_35215225的博客 394

第一次的java作业

第一次的作业,欢迎指教 作业1:a,b,c中最大值 package com.com.com; import java.util.*; public class TestDemo { public static void main(String[] args){ System.out.println(“请输入a”); Scanner scan = new Scanner(System.in);//...

qq_40873772的博客 146

我的第一次Java作业

课后作业

jjwlikegirl的博客 187

我的第一次JAVA作业

第二步是敲主函数, public static void main(String[] args) {第三步是敲一个形式,我用的是输出打印的函数System.out.println(“”)输入打印的内容。第一步是敲题目头,也就是代码的框架public class hello { }以上的三组图片是我的第一次Java作业,我的作业题目是。输出长春地铁一号线运行图。第五步查看自己有无错误。输出轨道交通充值信息。

2201_75851991的博客 75
上一篇: poi 读取Excel文件模板生成报表文件
下一篇: java第二次作业
VirusFu
博客等级 码龄21年 51粉丝 79原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值