Top Posters
Since Sunday
y
2
m
2
m
2
u
2
m
2
B
2
M
2
e
2
k
2
N
2
y
2
m
2
New Topic  
S.v Author
wrote...
7 months ago Edited: 7 months ago, S.v
right but the issue is that with those numbers he should be doing the laundry 9 times
Post Merge: 7 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...
7 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...
7 months ago Edited: 7 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: 7 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...
7 months ago
When you put in:

1, 3, 10, and 295?
S.v Author
wrote...
7 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...
7 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...
7 months ago Edited: 7 months ago, S.v
ok no problem ill submit it here once I figure it out
Post Merge: 7 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: 7 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...
7 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...
7 months ago Edited: 7 months ago, S.v
ok thanks I will update you once I get a response
Post Merge: 7 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
  510 People Browsing
Related Images
  
 4514
  
 340
  
 854
Your Opinion
Which industry do you think artificial intelligence (AI) will impact the most?
Votes: 486

Previous poll results: How often do you eat-out per week?