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;
}
}
}
}
}
...全文

相关推荐

通信行业基于MongoDB的安全合规与性能优化:5G时序数据处理、可查询加密及窗口函数应用

内容概要:本文围绕MongoDB在通信行业的深度应用,系统讲解了可查询加密、时间序列集合、窗口函数与性能诊断四大核心技术。通过详实的代码案例,展示了如何利用可查询加密实现敏感数据合规存储与查询,使用时序集合高效处理5G网络KPI等高频写入场景,借助窗口函数进行经营指标的趋势分析,并结合explain()与查询分析器完成性能调优。文章还涵盖分片一致性检查、索引优化等运维实践,全面覆盖通信系统对安全、性能与扩展性的严苛要求。; 适合人群:具备一定数据库基础,从事通信行业研发、架构或运维工作1-3年的技术人员,尤其是参与5G网络监控、客户数据管理或大数据平台建设的相关人员。; 使用场景及目标:① 实现用户手机号、身份证等敏感信息的加密存储与等值查询,满足安全合规要求;② 构建高吞吐、低延迟的5G基站KPI时序数据存储与分析系统;③ 在数据库层直接完成滑动平均、累计求和等经营分析,减少应用层计算负担;④ 诊断慢查询、验证索引有效性,保障系统高性能运行。; 阅读建议:此资源强调理论与实战结合,建议读者在本地或测试环境部署MongoDB 7.0+版本,动手复现文中代码,重点关注schemaMap配置、时序集合参数选择与窗口函数语法细节,并结合explain执行计划理解底层优化机制,从而真正掌握通信级数据架构的设计精髓。

数智顾问

国央企创新负责人如何借助平台实现技术成果的高价值转化与资源精准配置?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

BIZKEEN

产业园区运营负责人如何在平台建设中科学配置创新资源,提升园区内技术对接效率?.docx

产业园区运营负责人如何在平台建设中科学配置创新资源,提升园区内技术对接效率?

BIZKEEN

产业园区运营负责人如何提升园区内技术供需匹配的精准度?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

BIZKEEN

高校技术转移办公室人员如何提升科技成果推介的效率与质量?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

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