[ACM]HDU Problem 1000 + Java

//no package name
//import when necessary
import java.util.Scanner;

//it has to be Main class
public class Main {
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);

		//Wrong answer when using while(true)
		while(input.hasNext()){
			int a = input.nextInt(), b = input.nextInt();
			System.out.println(a+b);
		}
	}
}

  

原文地址:https://www.cnblogs.com/Vivianwang/p/10968583.html

时间: 2024-10-07 22:50:18

[ACM]HDU Problem 1000 + Java的相关文章

[ACM]HDU Problem 1001 + Java

import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); while(input.hasNext()){ int n = input.nextInt(); int sum = 0; //暴力加合 for(int i=1; i<n+1; i++){ sum+=i; } System.out.println(

[ACM] hdu 2089 不要62(数位Dp)

不要62 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 19043    Accepted Submission(s): 6442 Problem Description 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer). 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就

[ACM] hdu 1285 确定比赛名次 (拓扑排序)

确定比赛名次 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10358    Accepted Submission(s): 4046 Problem Description 有N个比赛队(1<=N<=500),编号依次为1,2,3,....,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直

[ACM] hdu 1231 最大连续子序列 (动规复习)

最大连续子序列 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 17687    Accepted Submission(s): 7828 Problem Description 给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 <= i <= j

[ACM] hdu 3555 Bomb (数位DP,统计1-N中含有“49”的总数)

Bomb Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 7187 Accepted Submission(s): 2512 Problem Description The counter-terrorists found a time bomb in the dust. But this time the terrorists impro

我的ACM——hdu 2016

decimal system Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3243 Accepted Submission(s): 1242   Problem Description As we know , we always use the decimal system in our common life, even using

[ACM] hdu 1228 A+B (字符串处理)

A + B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 11543    Accepted Submission(s): 6699 Problem Description 读入两个小于100的正整数A和B,计算A+B. 需要注意的是:A和B的每一位数字由对应的英文单词给出. Input 测试输入包含若干测试用例,每个测试用例占一行,

[ACM] hdu 1087 Super Jumping! Jumping! Jumping! (动态规划)

Super Jumping! Jumping! Jumping! Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 6   Accepted Submission(s) : 5 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description Nowada

[ACM] HDU 5131 Song Jiang&#39;s rank list (模拟)

Song Jiang's rank list Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others) Total Submission(s): 36    Accepted Submission(s): 18 Problem Description <Shui Hu Zhuan>,also <Water Margin>was written by Shi Nai'an