Beginner Series #1 School Paperwork

Lee·2022년 6월 23일

Algorithm

목록 보기
27/92
post-thumbnail

❓ Beginner Series #1 School Paperwork

Q. Your classmates asked you to copy some paperwork for them. You know that there are 'n' classmates and the paperwork has 'm' pages.

Your task is to calculate how many blank pages do you need. If n < 0 or m < 0 return 0.

Example:
n= 5, m=5: 25
n=-5, m=5: 0
Waiting for translations and Feedback! Thanks!

✔ Solution

//#1
function paperwork(n, m) {
  if(n>0 && m>0){
    return n*m;
  }else if(n <= 0 || m <= 0){
    return 0;
  }
}


//#2
function paperwork(n, m) {
  return n > 0 && m > 0 ? n * m : 0
}
profile
Lee

1개의 댓글

comment-user-thumbnail
2022년 9월 14일

School is not always easy. A lot of students have problems with writing school papers, it's really hard to do. Fortunately, there are many learning resources that you can find here https://www.fox13now.com/brand-spotlight/the-5-best-college-research-paper-writing-services. They will do all your writing very quickly and efficiently. This is a great way to raise your school grades to the highest possible level.

답글 달기