Preparing NOJ

# A+B Problem

0ms 0K

## Sample Input:

123 500

## Sample Output:

623

## Note:

### Free Pascal Code

var a, b:longint;
begin
writeln(a + b);
end.


### C Code

#include <stdio.h>

int main()
{
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
}


### C++ Code

#include <iostream>

using namespace std;

int main()
{
int a, b;
cin >> a >> b;
cout << a + b << endl;
}


### C# Code

using System;
using System.Linq;

class Program {
public static void Main(string[] args) {
}
}


### Python Code

print sum(map(int, raw_input().split()))


### Python 3 Code

print(sum(map(int, input().split())))


### Java Code

import java.io.IOException;
import java.util.Scanner;

public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(a + b);
}
}


### PHP Code

<?php

fscanf(STDIN, "%d %d\n", $a,$b);
echo ($a +$b) . "\n";


### Rust Code

use std::io;

fn main() {
let mut line = String::new();

let sum: i32 = line.split_whitespace()
.map(|x| x.parse::<i32>().expect("integer"))
.sum();
println!("{}", sum);
}


main = print . sum . map read . words =<< getLine


### Javascript Code

const [a, b] = readline().split(' ').map(n => parseInt(n, 10));
print((a + b).toString());


### Go Code

package main
import "fmt"
func main() {
var a, b int
fmt.Scanf("%d%d", &a, &b)
fmt.Printf("%d\n", a + b)
}


### Ruby Code

a, b = gets.split.map(&:to_i)
puts(a + b)


Info

Provider Vijos

Origin P1000 A+B Problem

Code VIJ1000

Tags

Submitted 103

Passed 70

AC Rate 67.96%

Date 07/21/2019 14:01:48

Related

Nothing Yet