zoj第1292题,为什么我的java程序提交到网站上时总显示runtimeerror,我在本地计算机能运行的啊

q564414118 q564414118 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
题目如下:
One of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various sums of those numbers.
``This supercomputer is great,'' remarked Chip. ``I only wish Timothy were here to see these results.'' (Chip moved to a new apartment, once one became available on the third floor of the Lemon Sky apartments on Third Street.)


Input

The input will consist of at most 100 lines of text, each of which contains a single VeryLongInteger. Each VeryLongInteger will be 100 or fewer characters in length, and will only contain digits (no VeryLongInteger will be negative).

The final input line will contain a single zero on a line by itself.


Output

Your program should output the sum of the VeryLongIntegers given in the input.


This problem contains multiple test cases!

The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.

The output format consists of N output blocks. There is a blank line between output blocks.


Sample Input

1

123456789012345678901234567890
123456789012345678901234567890
123456789012345678901234567890
0


Sample Output

370370367037037036703703703670


代码如下:
import java.util.Scanner;
import java.math.BigInteger;
public class Test1292{
public static void main(String args[]){
int i;
Scanner scan=new Scanner(System.in);
int n=scan.nextInt();
scan.nextLine();
System.out.println();
outer:for(i=0;i<n;i++){
String a=scan.nextLine();
BigInteger a1=new BigInteger(a);
if(a.equals("0")){
System.out.println();
System.out.println(a1);
System.out.println();
continue outer;
}
out:while(true){
String b=scan.nextLine();
BigInteger b1=new BigInteger(b);
a1=a1.add(b1);
if(b.equals("0")){
System.out.println();
System.out.println(a1);
System.out.println();
break out;
}
}
}
}
}
...全文

相关推荐

神经网络自校正PID控制器自适应PID研究(Matlab代码实现)

内容概要:本文系统研究了神经网络自校正PID控制器在自适应控制中的应用,重点通过Matlab代码实现了该控制器的设计与仿真,并将其应用于永磁同步电机(PMSM)等复杂非线性系统的速度控制中。文章详细对比了该方法与传统PID控制、滑模控制的性能差异,验证了其在动态响应精度、鲁棒性及自适应调节能力方面的显著优势。资源包还提供了丰富的Simulink仿真模型,涵盖无位置传感器控制、高频注入法、负载转矩估计、滑模观测器、谐波抑制、弱磁控制等多种先进电机控制策略,构建了一个面向高性能电机驱动的综合算法研究平台。; 适合人群:具备自动控制理论基础和Matlab/Simulink仿真能力的研究生、科研人员,以及从事电机控制、智能控制算法开发的工程技术人员。; 使用场景及目标:①深入掌握神经网络与PID融合的自校正机制及其在非线性系统中的自适应调控原理;②开展PMSM先进控制策略(如无感控制、滑模观测、负载估计)的建模仿真与性能对比分析;③支撑科研项目验证、学术论文复现或毕业课题的技术实现与创新拓展。; 阅读建议:建议结合所提供的Matlab代码与Simulink模型进行动手实践,重点关注控制器结构设计、参数整定过程及仿真结果分析,同时参考配套文献以深化对控制理论和工程应用背景的理解,从而实现从理论到仿真的完整闭环学习与创新能力提升。

@橘柑橙柠桔柚

usecase.svg

usecase.svg

2601_97257382

ESP32物联网开发实战项目 - 温湿度监测上云教程:DHT11采集、WiFi连接、MQTT上报、OLED显示与手机端查看全套源码

从接线到上云一步步做,每步含完整代码、接线表与预期输出,零基础照着做就能让温湿度数据实时显示在手机。 本教程做一个能联网的温湿度监测节点:ESP32 读取 DHT11 温湿度,本地 OLED 屏实时显示,同时通过 WiFi 把数据发到 MQTT 服务器,手机客户端订阅同一主题即可远程看到读数。 采用先拆后合的结构:DHT11 采集、OLED 显示、WiFi 连接、MQTT 上报四个模块各自有独立验证程序和预期串口输出,逐个跑通后再合并为完整监测程序,出错能快速定位到具体模块。

LCG元

x86 16位微处理器 8086的逻辑结构图

x86 16位微处理器 8086的逻辑结构图

iltrrain

md-20261204(fr1122).zip

md-20261204(fr1122).zip

chuchu00000000
评论
收藏 已收藏
分享
返回顶部
q564414118
Java 51,407 成员 86,172 内容