THE EXERCISE OF THE GUYS GUYS HAS BEEN MOVED TO THE MENU "EXERCISE OF Teacher"

How to submit

sample code:

  1. C / C ++
  2. Java language
  3. Language C #
  4. Python language
  5. JavaScript language
  6. Pascal
  7. PHP

To submit articles, you perform the following steps:

  • step 1: Log in or registration account.
  • step 2: Open exercises to do. Example Post total 2 number.
  • step 3: Read request Threads, pay attention to the input (input) and output (output) and examples to understand the problem.
  • step 4: Code. You can code directly on the web or on your ZIP code into the frame and copy editor (black coal).
  • step 5: Select the language you write (below the frame editor).
  • step 6: Submit button and wait Click view results below. The system will have tests for each post, What tests will show the letter properly Accepted green Blue. If the test does wrong will display text Wrong Answer red and some details:
    – input: Input of test
    – output: The output of the test
    – your output: Your output.
    Based on this, you can adjust your way to the right.

Important note:

  • In your code just reading and outputting the results, but to all requests, contest, enough. Example review 2 number as above, you just exported results, not made anything like: printf(“Nhap a = “); Such excess.
  • In your code not used the command to stop the screen or special system commands like system(“pause”), getch(),…
  • Trong code not used library conio.h (with C / C ++).
  • With all the strings, you not use fflush(stdin) to clear buffer, if to remove the buffer, use fgets 2 once for strings.
  • For java, you named class always Main (class Main).
  • For pascal, you do not use the library crt nhé.
  • If that is all include conditions, then the value of the number of tests will be standardized so. For the x < 100 then surely the test will always be x < 100, you without check whether to satisfy the condition x < 100 or not.

Code examples for all sums 2 the language C:

#include <stdio.h>
int main() {
    int a, b;
    scanf("%d%d", &a, &b);
    printf("%d", a + b);
    
    return 0;
}

Code examples for all sums 2 the language Java:

import java.util. *;
class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        System.out.println(a + b);
    }
}

Code examples for all sums 2 the language C #:

using System;
 
public class Test
{
	public static void Main()
	{
		// Train as it cac tat Doc 1 dong
		var numbers = Console.ReadLine();
		// tach cac so ra boi dau cach
var numberList = numbers.Split(' ');
        
		// Specializing in numerical solution for each issue
var number1 = Convert.ToInt32(numberList[0]);
		var number2 = Convert.ToInt32(numberList[1]);
        
		// output tong 2 so
		Console.WriteLine(number1 + number2);
	}
}

Code examples for all sums 2 Some language Python:

# Doc 2 so tren 1 dong
a, b = map(int, input().split())

# Cong 2 so
sum = a + b

# in ra tong
print(sum)

Code examples for all sums 2 the JavaScript language:

// nhap 2 so tren 1 Dong, separated by spaces, tinh tong
process.openStdin().on ('data', 
    function (line) {
	    // tach cac so tren 1 dong by space
        var arr = String(line).split(' ')
		// brought to book and get the total
        console.log (parseInt(arr[0]) + parseInt(arr[1]))
        process.exit()
    }
)

Code examples for all sums 2 the language Pascal:

program chamcode;
There are a, b : integer;
begin
	read(a); read(b);
	writeln(a+b);
end.

Code examples for all sums 2 Some language PHP:

<?php
// read all input
$input = stream_get_contents(STDIN);

// split input by space
$nums = explode(" ", $input);

// print result
echo $nums[0] + $nums[1];

Code examples for all trade summed integrated PHP performance:

<?php
// read all input
$input = stream_get_contents(STDIN);

// split input by space
$nums = explode(" ", $input);

// print result
$sum = $nums[0] + $nums[1];
$sub = $nums[0] - $nums[1];
$mul = $nums[0] * $nums[1];
$div = $nums[0] / $nums[1];
print $sum . ' ' . $sub . "\n";
print $ mul . ' ' . number_format($div, 2);
4 Comments

Add a Comment