Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program which reads the statistics of n League A football teams and prints the team's name which fall in League B . A

Write a program which reads the statistics of n League A football teams and prints the team's name
which fall in League B. A team falls in League B, if it has less than k points after having played m weeks
where m is between 1 and 150. Each team gets three points for a win, one point for a draw and zero
points when lost.
Input Specification: In the first line, you will be given the number of teams 0< n <=500 and the points 0<
k <=300 needed to stay in league A. Then in the following n lines, there will be the
team name and its results. Semicolon indicates the end of the input series.
Number 2 represents win, number one represents draw and number zero represents loss.
Output Specification: Show the team names and their points which fall to League B. If no team falls to
League B then shows "0 Teams" message.
Sample Input 1: Sample Input 2:
419415
Team_A 11111111101110210 ; Team_00102211202022011 ;
Team_B 01022110110201002 ; Team_00202120010110121 ;
Team_C 00102221111100212 ; Team_00302120102001012 ;
Team_D 01012121000222000 ; Team_00410200112002120 ;
Sample Output 1: Sample Output 2:
Team_A 160 Teams
Team_B 18

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions