Skip to content

Commit d3b989d

Browse files
authored
Add files via upload
Coldplay Tickets Problem Problem Statement: You are going to the Coldplay concert with N friends and buying tickets for everyone. Each ticket costs 5000 INR. Calculate the total amount to pay for all tickets, including your own. Input: A single integer N (number of friends). Output: Total cost in INR for N + 1 tickets. Constraints: 1 ≤ 𝑁 ≤ 5 1≤N≤5 Example: Input: 1 Output: 10000 Input: 5 Output: 30000
1 parent b043f06 commit d3b989d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

COLDPLAYTICK.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import java.util.*;
2+
import java.lang.*;
3+
import java.io.*;
4+
5+
class Codechef
6+
{
7+
public static void main(String[] args) throws java.lang.Exception
8+
{
9+
// your code goes here
10+
11+
Scanner sc = new Scanner(System.in);
12+
int N = sc.nextInt();
13+
int Total_friends = N + 1;
14+
15+
// for(int i = 1 ; i<=N ; i++){
16+
17+
// System.out.println(i*5000);
18+
// }
19+
20+
21+
System.out.println(Total_friends * 5000);
22+
23+
24+
}
25+
}

0 commit comments

Comments
 (0)