Not logged in. Log in with GitHub. About Websheets.

List of all available Websheets


Viewing cpp/cs103/hw-recursion/binarize by redekopp@usc.edu. You have unsaved changes. Log in above to create, edit, preview and publish Websheets.
PropertyValue
Description
html markup
shown to student
 
Define a recursive function <tt>void binarize(int n)</tt>
which prints out the binary equivalent of the positive integer <tt>n</tt>.
<br>
For example, <tt>binarize(6)</tt> should print <tt>110</tt>.
Engine
Template / Reference solution
 
#include <iostream>
using namespace std;
void binarize(int n) {
\[
REDACTED
]\
}
int main()
{
   int n;
   cin >> n;
   binarize(n);
}
C++ test suite
json list of stdin/args tests
e.g. [{"stdin":"hi", "args":["4", "5"]},
{"stdin":"noargs"}]

to just run once with no input use [{}]
 
[
   {"stdin": "6"},
   {"stdin": "2"},
   {"stdin": "13"},
   {"stdin": "1"},
   {"stdin": "103"},
   {"stdin": "17"},
   {"stdin": "22"},
   {"stdin": "1812"},
   {"stdin": "2147483647"}
]
Forbidden substrings
json list of strings
e.g. ["for","while"]
 
["#include", "for", "while"]
remove


Optional properties:

Note: problems are open-source by default (see 'Public permissions'). Assumed license for open problems is Creative Commons 4.0 Attribution-ShareAlike unless specified in 'Remarks'.