Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a program that reads all the match outcomes and summarizes the information of all the matches. A win earns a team 3 points. The team information should be displayed in descending order of points.

Input:

The first line contains a single integer N, denoting the total no. of matches played.

The following N lines contain outcomes of N matches. Each of those lines has information on the teams (T1, T2) which played and the outcome (O) in format T1;T2;O. The outcome (O) is one of 'win', 'loss', 'draw' and refers to the first team listed. The team name may contain spaces.

Output:

The output should contain summarized information of all the matches in a format similar to 'Team: CSK, Matches Played: 4, Won: 2, Lost: 1, Draw: 1, Points: 7' for each team in a new line. If there are no teams to print in summary, print "No Output". Constraints

Names of teams may contain spaces but will be less than 24 characters

100 >= N >= 0


Multiple of 5

You are given N inputs. Print the given inputs until you encounter a multiple of 5.Input

The first line of input is an integer N. The next N lines each contain an integer as input.

Explanation

In the given example, there are

6 inputs. 1, 2, 3, 5, 9, 6After

3, we have encountered 5, which is a multiple of 5.So, the output should be


1

2

3


Sample Input 1

6

1

2

3

5

9

6

Sample Output 1

1

2

3

Sample Input 2

5

1

2

3

4

5

Sample Output 2

1

2

3

4




First Prime Number

You are given N inputs. Write a program to print the first prime number in the given inputs.

Input

The first line of input is an integer N. The next N lines each contain an integer. Explanation

In the given example of

5 integers

1

10

4

3

2


The output should be

3.

Sample Input 1

5

1

10

4

3

2

Sample Output 1

3

Sample Input 2

4

2

3

5

7

Sample Output 2

2




W pattern with *

Write a program to print W pattern of N lines using an asterisk(*) character as shown below.

Note: There is a space after each asterisk * character.

Input

The first line is an integer N.

Explanation

For

N = 5The output should be


* * * * * * * * *

* * * * * * * *

* * * * * *

* * * *

* *


Sample Input 1

5

Sample Output 1

* * * * * * * * *

* * * * * * * *

* * * * * *

* * * *

* *

Sample Input 2

4

Sample Output 2

* * * * * * *

* * * * * *

* * * *

* *




Armstrong numbers between two intervals

Write a program to print all the Armstrong numbers in the given range A to B(including A and B). An N-digit number is an Armstrong number if the number equals the sum of the Nth power of its digits.

Input

The first line has an integer A. The second line has an integer B.

Output

Print all Armstrong numbers separated by a space.

If there are no Armstrong numbers in the given range, print -1.

Explanation

For

A = 150 and B = 200For example, if we take number 153, the sum of the cube of digits

1, 5, 3 is 13 + 53 + 33 = 153.

So, the output should be

153.

Sample Input 1

150

200

Sample Output 1

153

Sample Input 2

1

3

Sample Output 2

1 2 3




Smallest Missing Number


Given a list of numbers, write a program to print the smallest positive integer missing in the given numbers.


Input


The input will be a single line containing numbers separated by space.

Help me to do this not coimg correcr answer


Write a C++ program that read numbers from an integer array and graph the information in the form of bar chat. Sample output is given below. Element Value Histogram 0 19 ******************* 1 3 *** 2 15 *************** 3 7 ******* 4 11 *********** 5 9 ********* 6 13 ************* 7 5 ***** 8 17 ***************** 9 1 *


Create a class named 'Rectangle' with two data members- length and breadth and a function to calculate the area which is 'length*breadth'. The class has three constructors which are : 1 - having no parameter - values of both length and breadth are assigned zero. 2 - having two numbers as parameters - the two numbers are assigned as length and breadth respectively. 3 - having one number as parameter - both length and breadth are assigned that number. Now, create objects of the 'Rectangle' class having none, one and two parameters and display their areas. 


An electricity board charges the following rates to domestic users to discourage large consumption of energy :For the first 100 units : 50 P per unit and Beyond 300 units : 60 P per unit, 100-300 units:55 pIf the total cost is more than Rs.250.00 then an additional surcharge of 15% is added on thedifference. Define a class Electricity in which the function Bill computes the cost


Shot put reward

In the game of shot put, a heavy ball is thrown by players to the farthe academy, the coach offers some chocolates to the players performing them. The players stand in a line and take turns for throwing the ball or who makes an attempt knows his/her score after the attempt. A player can ask the score of the player just adjacent to him/her and th player. The coach decides to give chocolates in such a way that no pla fewer chocolates than he/she should get. Find the minimum chocolates

Input Specification:

input1: Number of players

input2: Integer array containing the scores of players

Output Specification:

Return the minimum number of chocolates given to each player by the

coach.

Example 1:

input1: 5

input2: (35,14,42,44,39}

Output: 6

Type here to search
LATEST TUTORIALS
APPROVED BY CLIENTS