Top Posters
Since Sunday
8
5
z
4
n
4
t
4
3
k
3
x
3
r
3
m
3
j
3
c
3
New Topic  
S.v Author
wrote...
6 months ago Edited: 6 months ago, S.v
right but the issue is that with those numbers he should be doing the laundry 9 times
Post Merge: 6 months ago

To be honest I don't know where the issue in the code is, the inputs look fine, and the if statements make sense. I don't know why the output is wrong.
Answer accepted by topic starter
AnonymousAnonymous
wrote...
6 months ago
Sign in or Sign up in seconds to unlock everything for free
This verified answer contains over 360 words.
1

Related Topics

S.v Author
wrote...
6 months ago Edited: 6 months ago, S.v
AMAZING, I just tried it with another set of numbers that the teacher gave me but it doesn't match up.

input: 1 3 10 2 9 5
output: 3

the output I got was 4

Post Merge: 6 months ago

Ive attached a picture of what the teacher has given us
 Attached file 
Thumbnail(s):
You must login or register to gain access to this attachment.
Anonymous
wrote...
6 months ago
When you put in:

1, 3, 10, and 295?
S.v Author
wrote...
6 months ago
when i put in 1 3 10 and the days are 2, 9, and 5

if you check the image it should help explain what im trying to say
Anonymous
wrote...
6 months ago
I can't get it to work no matter what i try sorry

please share with us the solution when you finally get it
S.v Author
wrote...
6 months ago Edited: 6 months ago, S.v
ok no problem ill submit it here once I figure it out
Post Merge: 6 months ago

Ok I think I might've figured out why the output is different. So the code is completely correct there are 4 times when the shirt count hits 0 but I don't think that he needs to do the laundry on the last day, maybe we dont count if the shirt count hits 0 on the last day? If thats not the problem then I will ask my teacher about it
Post Merge: 6 months ago

Ok now that I think about it more I believe that its my teachers fault for writing 3 I believe it should be 4, I've emailed my teacher about this issue and I'll wait for a response.
Anonymous
wrote...
6 months ago
I was thinking the same!

I am going to try writing it in php, then change it to python

please let me know what ur teacher writes
S.v Author
wrote...
6 months ago Edited: 6 months ago, S.v
ok thanks I will update you once I get a response
Post Merge: 6 months ago

Turns out your code is correct and the teacher made a mistake
  New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  823 People Browsing
Related Images
  
 4499
  
 326
  
 845
Your Opinion
What's your favorite math subject?
Votes: 559