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

List of all available Websheets


Viewing cpp/control/badloops by daveagp@gmail.com. You have unsaved changes. Log in above to create, edit, preview and publish Websheets.
PropertyValue
Description
html markup
shown to student
 
Write a program that takes two inputs <tt>h</tt> and <tt>w</tt>
and draws a grid of equals signs of height <tt>h</tt> and width <tt>w</tt>.
E.g. if the input is <tt>2 3</tt> the output should be:
<pre>
===
===
</pre>
Public permissions remove
Engine
Template / Reference solution
 
#include <iostream>
using namespace std;
int main() {
   int h, w;
   cin >> h >> w;
\[
   for (int i=0; i<h; i++) {
      for (int j=0; j<w; j++) {
         cout << "=";
      }
      cout << endl;
   }
\show:
   int i;
   for (i=0; i<h; i++) {
      for (i=0; i<w; i++) {
         cout << "=";
      }
      cout << endl;
   }
]\
   return 0;
}
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": "2 3"},
   {"stdin": "10 4"}
]
Solution visibility 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'.