C++ 24hr Challenge


#1

A fun little challenge for beginners in C++, here is the problem:

Write a program which converts uppercase letters to lowercase, assuming an ASCII representation. You may only use (cin and cout) and arithmetic operators(+,-,*,/,%). You may not use conditional statements (if or ?: the like). Use static_cast() to convert from int to char.

Ex:
If the input is uppercase, the result should be lowercase.

Enter a letter : Y
Your letter in lowercase is y.

If the input is already in lowercase, just give the same.

Enter a letter: b
Your letter in lowercase is b.

If the input is not a letter, I don’t care about the output.

Enter a letter: $
I don’t care about the output.

GoodLuck! I will post a variation of the answer once the challenge ends(24hrs). GLHF. ~ wawa


(oaktree) #2

Wait. So if it’s not a letter, the output doesn’t matter?

What I have so far…


#3

Yup Yup, Only letters. I’ll be back in a couple of hrs, gonna run some errands. TTYL.


#4

C++ variation of the challenge. This one was not done by me, but by my one of my good friends, Martin.

http://pastebin.com/NL7X5U2n