Skip to content

Commit

Permalink
Add tutorial for LOJ-1000 : Greeting on LightOJ (#1)
Browse files Browse the repository at this point in the history
* Add english tutorial for LOJ-1000

* Add bangla tutorial for LOJ-1000

Problem Name: Greetings on LightOJ
  • Loading branch information
faiyaz26 authored Nov 14, 2020
1 parent 22f5094 commit 953f289
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
55 changes: 55 additions & 0 deletions 1000/bn.md
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())))
```
55 changes: 55 additions & 0 deletions 1000/en.md
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())))
```

0 comments on commit 953f289

Please sign in to comment.