The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
And as others pointed out. a should not be expected in the output. Unless modulo was part of the previous discussions, and the person that wrote the question assumed and mixed up "a%10 == 0" being a possible solution, should be corrected.
That was my point of the comments in that question. But seeing that there were more people thinking the same (or having the same error)... is when I thought maybe is different meaning for english natives and the point of this question.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
You mean, like in Fortan? 1-based. Pascal? Arbitrary base. ALGOL? Arbitrary base CHILL, aka ITU Z.200? Arbitrary base. What about APL, the ultimate array language? 1-based.
Or anywere outside the programming world? If you are guided to take the third row to the right, do you then count: Road zero, road one, ...? If your coworker tells that is first child is named John, do you then ask what his oldest one is named? If you are asked to bring a message to the second person from the left, do you then count: 0, 1, 2 to decide who to deliver the message to? Do you often see books paginated from zero? Parking lots or apartments numbered from zero?
Outside the C class of programming languages, arrays, sequences and related phenoena are pratically always either 1-based or arbitrarily based.
There is one exception that I learned when working on a project with Korean participants: While our age concept is based on the number of years you have completed - you are not one year old until you have completed a full year (0-based). Koreans count the year you are in: From birth, you are in your first year (1-based). And since they also count moon years, not sun years, if you ask for their age, they may have to think for a couple of seconds to calculate their age in Western terms. (Note: With 50+ million people, there may be differenc subcultures with different traditions - I am referring to what was explained to me by those active on this project).
You could also count time as zero based: Until an hour has passed since midnight, you do not call it "hour one". At that time, most of us are asleep, so we don't care that much. But note that even in AM/PM cultures, we do not like the zero base, but refer to 12:30 PM, even though in a 0-base time we really ought to refer to it as 0:30 PM
One of the two brothers who did so much to teach post-war Britain that food could be tasty as well as eaten.*
I'm quite surprised he lasted this long, given that most of their recipes contains two pints of cream and a pound of butter...
* Mind you, that didn't take much: the height of sophistication then was three foot long strands of spaghetti served in a heated chopped tinned tomato (called "spag bol") with "parmesan" that was pre-grated at the factory...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
yes a lot of those items were used, and not to spare the salt.
the secret was to not eat so much, rather a smaller piece of the "main event" and lashings of fresh veggies.
...these days it's a 2 lb steak dolloped with a spoon of bearknees sauce, a pound of deep fried chips and 3 carrot sticks shavings.
(to make it fancy in upmarket establishments for 10 times the price they'll serve a 1 oz steak on an oversized plate, the 'gourmet' (??) fries in a basket and squirt a streak of something unpronounceable over the otherwise vacant real estate. oh, and only 2 carrot shavings but more neatly arranged.)
pestilence [ pes-tl-uh ns ] noun
1. a deadly or virulent epidemic disease. especially bubonic plague.
2. something that is considered harmful, destructive, or evil. Synonyms: pest, plague, people
I love a challenge, but I hate unsolvable problems. Actually they are not unsolvable, but what company is going to pay me to spend months or years to find the answer.
Unsolvable means I do not have access to the source code and therefor I am left guessing as to what the system call actually does. We are limited to what we can see.
I've set two unsolved ones this week
That is a sure sign that you live in my world. Unfortunately, the bean counters do not see the value.
"Program testing can be used to show the presence of bugs, but never to show their absence." - Edsger Dijkstra
"I have never been lost, but I will admit to being confused for several weeks. " - Daniel Boone