-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tutorial for LOJ-1000 : Greeting on LightOJ (#1)
* Add english tutorial for LOJ-1000 * Add bangla tutorial for LOJ-1000 Problem Name: Greetings on LightOJ
- Loading branch information
Showing
2 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# LOJ 1000 - Greeting on LightOJ | ||
|
||
এটি লাইটওজে ভলিউমের সবচেয়ে সহজ সমস্যা। আপনাকে যা করতে হবে তা হ'ল প্রতিটি ক্ষেত্রে ইনপুট `a` এবং `b` এর যোগফল প্রিন্ট আউট করা। | ||
|
||
তবে এর পরেও কিছু প্রব্লেম সল্ভার সঠিক আউটপুট ফর্ম্যাট অনুসরণ না করার কারণে সফল হতে পারে না। | ||
|
||
1. আপনি প্রতিটি লাইনে নিউলাইন প্রিন্ট করেছেন তা নিশ্চিত করুন। | ||
2. সমস্যা বিবরণীতে দেয়া নমুনা আউটপুট এবং আপনার আউটপুট একই কি না তা নিশ্চিত করুন, কেস নম্বরটি একবার দেখুন। | ||
3. আপনি আউটপুটে সঠিক পরিমাণে ফাঁকা স্থান যোগ করেছেন তা নিশ্চিত করুন। | ||
|
||
আপনি যদি এখনও এই সমস্যায় আটকে থাকেন তবে নীচের কোডগুলি দেখুন: | ||
|
||
### C | ||
----- | ||
```c | ||
#include <stdio.h> | ||
|
||
int main() { | ||
int cases, caseno; | ||
scanf("%d", &cases); | ||
for (caseno = 1; caseno <= cases; ++caseno) { | ||
int a, b; | ||
scanf("%d %d", &a, &b); | ||
printf("Case %d: %d\n", caseno, a + b); | ||
} | ||
return 0; | ||
} | ||
``` | ||
|
||
### Java | ||
----- | ||
```java | ||
package com.loj.volume; | ||
|
||
import java.util.Scanner; | ||
|
||
class GreetingsFromLoj { | ||
public static void main(String[] args) throws Exception { | ||
Scanner scanner = new Scanner(System.in); | ||
int cases = scanner.nextInt(); | ||
for (int caseno = 1; caseno <= cases; ++caseno) { | ||
int a = scanner.nextInt(); | ||
int b = scanner.nextInt(); | ||
System.out.println("Case " + caseno + ": " + (a + b)); | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### Python 2 | ||
----- | ||
```python | ||
for i in xrange(int(raw_input())): | ||
print "Case %i: %i" % (i + 1, sum(map(int, raw_input().split()))) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# LOJ 1000 - Greeting on LightOJ | ||
|
||
It is the easiest problem on LightOJ volumes. All you have to do is print out the sum of input `a` and `b` on each case. There is nothing tricky about it. | ||
|
||
But still some people can't get `Accepted` verdict because of not following the proper output format. | ||
|
||
1. Make sure you have printed newline on each line | ||
2. Make sure you have same output as the sample output on the problem descriptin, take a look at case number. | ||
3. Make sure you have added right amount of spaces on the output. | ||
|
||
If you are still stuck with this problem, check the codes below: | ||
|
||
### C | ||
----- | ||
```c | ||
#include <stdio.h> | ||
|
||
int main() { | ||
int cases, caseno; | ||
scanf("%d", &cases); | ||
for (caseno = 1; caseno <= cases; ++caseno) { | ||
int a, b; | ||
scanf("%d %d", &a, &b); | ||
printf("Case %d: %d\n", caseno, a + b); | ||
} | ||
return 0; | ||
} | ||
``` | ||
|
||
### Java | ||
----- | ||
```java | ||
package com.loj.volume; | ||
|
||
import java.util.Scanner; | ||
|
||
class GreetingsFromLoj { | ||
public static void main(String[] args) throws Exception { | ||
Scanner scanner = new Scanner(System.in); | ||
int cases = scanner.nextInt(); | ||
for (int caseno = 1; caseno <= cases; ++caseno) { | ||
int a = scanner.nextInt(); | ||
int b = scanner.nextInt(); | ||
System.out.println("Case " + caseno + ": " + (a + b)); | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### Python 2 | ||
----- | ||
```python | ||
for i in xrange(int(raw_input())): | ||
print "Case %i: %i" % (i + 1, sum(map(int, raw_input().split()))) | ||
``` |