# CSC3100 Assignment 1 solution

\$25.00

Original Work ?

5/5 - (1 vote)

## B. Example Problem: A + B Problem

Description Given 2 integers A and B, compute and print A + B Input Two integers in one line: A, and B Output One integer: A + B Sample Input 1 1 2 Sample Output 1 3

For 100% of the test cases, 0 ≤ A, B ≤ 106 1 Solutions Java import java . util .*; public class Example { public static void main ( String [] args ) { int a , b; Scanner scanner = new Scanner ( System . in ); a = scanner . nextInt (); b = scanner . nextInt (); scanner . close (); System . out . println (a + b ); } } Python AB = input (). split () A , B = int ( AB [0]) , int ( AB [1]) print (A + B ) C # include < stdio .h > int main ( int argc , char * argv []) { int A , B ; scanf (“%d%d”, &A , &B ); printf (“%d\n”, A + B ); return 0; } C++ # include < iostream > int main ( int argc , char * argv []) { int A , B ; std :: cin >> A >> B; std :: cout < < A + B << std :: endl ; return 0; }

C. Submission After finishing this assignment, you are required to submit your code to the Online Judge System (OJ), and upload your .zip package of your code files and report to BlackBoard. C.1 Online Judge Once you have completed one problem, you can submit your code on the page on the Online Judge platform (oj.cuhk.edu.cn, campus only) to gain marks for the code part. You can submit your solution of one problem for no more than 80 times. After you have submitted your program, OJ will test your program on all test cases and give you a grade.

The grade of your latest submission will be regarded as the final grade of the corresponding problem. Each problem is tested on multiple test cases of different difficulty. You will get a part of the score even if your algorithm is not the best.

2 Note: The program running time may vary on different machines. Please refer to the result of the online judge system. OJ will show the time and memory limits for different languages on the corresponding problem page. If you have other questions about the online judge system, please refer to OJ wiki (campus network only).

If this cannot help you, feel free to contact us. C.2 BlackBoard You are required to upload your source codes and report to the BlackBoard platform. You need to name your files according to the following rules and compress them into A1_.zip : A1_ < Student ID >. zip |– A1_P1_ < Student ID >. java / py /c/ cpp |– A1_P2_ < Student ID >. java / py /c/ cpp |– A1_Report_ < Student ID >. pdf For Java users, you don’t need to consider the consistency of class name and file name.

For example, suppose your ID is 123456789, and your problem 1 is written in Python, problem 2 is written in Java then the following contents should be included in your submitted A1_123456789.zip: A1_123456789 . zip |– A1_P1_123456789 . py |– A1_P2_123456789 . java |– A1_Report_123456789 . pdf C.3 Late Submissions Submissions after Oct 6 2023 23:59:00(UTC+8) would be considered as LATE. The LATE submission page will open after deadline on OJ.

Submisson time = max{latest submisson time for every problem, BlackBoard submisson time} There will be penalties for late submission: • 0–24 hours after deadline: final score = your score×0.8 • 24–72 hours after deadline: final score = your score×0.5 • 72+ hours after deadline: final score = your score×0 FAQs Q: I cannot access to Online Judge. A: First, please ensure that you are using the campus network. If you are not on campus, please use the university VPN.