ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1000. A+B Problem

!!!??? Java omg!!!!!!!!!!!!!!!!!
Posted by Mikhail 15 Jul 2016 16:53
import java.util.*;
public class Math{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextByte();
        int b = scanner.nextByte();
        System.out.print(a + b);
    }
}

Почему Runtime error??
Re: !!!??? Java omg!!!!!!!!!!!!!!!!!
Posted by Oleg Baskakov 15 Jul 2016 17:34
Попробуй nextInt вместо nextByte. В подавляющем большинстве случаев в задачах на тимусе чаще встречаются 4-байтные переменные, чем 1-байтные.
Re: !!!??? Java omg!!!!!!!!!!!!!!!!!
Posted by Mikhail 15 Jul 2016 19:31
Спасибо, помогло