CodeSolved

Solved Programming Questions & Exercises

Calculate the football team points

Practice Easy 1626/ Download 1275 Views

You will be given the score of a team that has won the Premier League at the entrance and you are printing the team's scores along with the number of wins this season at the output.

The team will play 2 games, so you will be given 2 points. For each team game either zero scored or one or three points. The team will score three points in the event of a zero -point loss, in the event of a draw.

Sample Input:

3 3
3 3
3 0
0 0
0 0
1 1
1 1
1 3
3 3
3 3
0 0
0 0
0 1
1 1
1 1

11 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
from random import *
sum = 0
for i in range(1,16):
    golus = randint(0,3)
    golthey = randint(0,3)

    if golus == golthey:
        point = 1
        sum += point
    elif golus < golthey:
        point = 0
    else:
        point = 3
        sum += point

    print(golus,"_", golthey , "point=",point) \
print("sum points =",sum)

User 3382 Download Python
team1=[3,3,3,0,0,1,1,1,3,3,0,0,0,1,1]
team2=[3,3,0,0,0,1,1,3,3,3,0,0,1,1,1]                    
victory_team1=0
victory_team2=0
def victory(a,b):
    global victory_team2,victory_team1
    for tem1,tem2 in zip(a,b):
        if tem1 == 3:
            victory_team1+=1
        if tem2 == 3:
            victory_team2+=1
victory(team1,team2)

print(f"team score1: {sum(team1)}")
print(f"team victories1: {victory_team1}")
print("----------------------")
print(f"team score2: {sum(team2)}")
print(f"team victories2: {victory_team2}")
v,b=0,0
for i in range(15):
   x = int(input("enter :"))
   v = v + x
   if(x==3):
       b=b+1
print(b)
print(v)
Kordawan Download Python
v,n,b=0,0,0
for i in range(15):
   x = int(input("enter :"))
   if(x==3)or(x==1)or(x==0):
     v = v + x
     if(x==3):
         b=b+1
   else:
       print("eruor")
       n=1
       break
if(n==0):
  print(b)
  print(v)
Kordawan Download Python
input_choice = ["0","1","3"]
score_input = "1,1,1,3,3,3,3"
scores_list = score_input.split(",")
scores = []
win = 0

for score in scores_list:
    if score in input_choice:
        score = int(score)
        scores.append(score)
        if score == 3:
            win += 1
    else:
        print("Value is Not Valide")

print(f"Your Scores is : {sum(scores)}")
print(f"The Number Of Win is : {win}")

User 3542 Download Python
#include<iostream>
int main(){
    int sum=0;
    int won=0;
    int equal=0;
    int fail=0;
    for (int i=1;i<=15;i++){
    std::cout<<"Enter scors:";
    int score;
    std::cin>> score;
    if(score==0||score==1||score==3){
        sum+=score;
        if (score==3)
            won++;
        if (score==1)
            equal++;
        if (score==0)
            fail++;
    }
    else
       std::cout<< "Enter correct score: ";}
    std::cout<<"this team's score: "<<sum<<" from "<<won<< " victory and "<<equal<< " equality and "<<fail<< " failure ";
    return 0;
User 3596 Download C & C++
equal_scores=0
lose=0
win_scores=0
count=0

for i in range(15):
    scores1, scores2 = map(int, input("Enter the results: ").split())
    if scores1==scores2:
        equal_scores+=1
    elif scores1<scores2:
        lose+=0
    elif scores1>scores2:
        win_scores+=3
        count+=1

all_scores=win_scores+equal_scores
print("kol:",all_scores,"\ntedad_win:",count)

User 3161 Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close