I think
mikeb570's responses are worded a little more roughly than they need to be, but he is right in the essentials.
While we don't want to just
give away answers (we'll make you sweat for them, and when you know enough to help others you'll make them sweat for them too), the main reason is that we want to tailor our responses to best suit your needs.
In order to do that, and as part of organizing the problem better in your own brain, you need to be as explicit as possible
and show us what you've tried. It would be very easy for us to answer in a way that is both or either entirely incomprehensible and useless to your task.
Are you using
arrays or are you still just writing output to the screen with
cout?
Is the purpose of the exercise to familiarize you with a loop construct (aka
for or
while or
do..while)?
Do what you can, post it, and we'll help correct and refine.
[
code]
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!\n";
return 0;
}
[
/code]
becomes:
1 2 3 4 5 6 7 8
|
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!\n";
return 0;
}
|
@
mikeb570
I tend to not use the [c0de] example because many times people will actually type "[c0de]" and still get it wrong. You can break the bbcode parser and show the actual tag used by inserting other tags immediately after the opening bracket:
[[
b][
/b]code] --> [
code]
[[
b][
/b]/code] --> [
/code]
Cool, no?
Hope this helps.