Row code C++

Hello, i am beginner here.
I wanna ask code in C++ about:

>> make row/line code in C++ from THESE OUTPUT:

1) 122333444455555666666

and

2) 112123123412345123456

Can everybody give me code in C++ ? :)
I appreciate that. Thanks in advance

-sorry for poor english
Last edited on
Where is your input coming from? A console or a file?
Are you trying to store the whole thing as one number or separately?
Well, theoretically - yes. We can give you code. But we don't like to do it(and hopefully - nobody will). It is because as a beginning programmer, you have to learn that YOU create code. If you only use code that somebody else created - you are as good ac ctrl+c ctrl+v combination.

So what should you do? Try to do it by yourself. If you come up with idea, and say "okay, so it's not working, please help" - and give us your code(using code tags) - it's nice start. What is better start? Comment your code as deeply as you can - not with // , but by posting it. Tell us what your code does. Step by step. It can also make it simpler to read it. Tell us what you think your code is doing, what it should do, where you think error is.
Every time I encounter a bug I can't fix, I spend much time looking for a bug. I try to find it, and only if I really can not - I start writing a post... And I have never posted a single question about finding bug since I used method described above. If you understand what your code does and explain step by step, you will eventually find what is wrong in your code. I encourage you to do the same. You never learn as much as when you do something by yourself.

Also, your question is not clear about what you want to achieve. Fix things I explained in my post, and you will have high chance of getting an answer.

Cheers!
Okay MatthewRock, i've been working, here the code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

using namespace std;

int main()
{
    int c,r;

      for (int r=1; r<=6; r++)
      {
        for (int c=1; c<=r; c++)
        {
            cout << r << "";
        }
            cout << endl;
      }
  return 0;
}


BUT, the output is DOWN VERTICAL, how I change that code for output to HORIZONTAL?
Try deleting
cout<<endl; statement
Okay, it's work, thank you eyenrique
Topic archived. No new replies allowed.