Pascal Yang Hui Triangle Help me see what went wrong with my program

Updated on number 2024-02-09
10 answers
  1. Anonymous users2024-02-05

    Don't capitalize it, no, it hurts to look at your head.

  2. Anonymous users2024-02-04

    No single program can achieve unlimited data requirements!!

    This program is correct within a certain range of rows.

    To print 20 lines, modify as follows:

    tab(j * 6 - 5 + n - i) *3); a(i, j);

    for tab(j * 8 - 5 + n - i) *4); a(i, j);

    Here 6 and 8 are the widths of each data, and 3 and 6 are half of the width of the data.

  3. Anonymous users2024-02-03

    Later, the number of digits becomes wider, of course, it is not neat, you can get the width of the maximum number before you start filling in the number, and then set this width for each number.

  4. Anonymous users2024-02-02

    1 Renderings.

    Please press any key to continue. .

    2 Source**:

    #include

    #include ""

    int main()

    for(i=1;i<=10;i++)

    system("pause");

    return 0;

    3. Ideas.

    1:a[0][0] = 1;

    a[1][0] = 1;

    a[1][1] = 1;

    The first 3 elements of the triangle are all 1

    2: The elements on the diagonal of the array and the elements in the first column are both 1, so a[i][1] = 1;

    a[i][i] = 1;

    3:a[i][j] = a[i-1][j-1]+a[i-1][j];

    The other elements are equal to the sum of the two elements on the shoulders and good luck!

  5. Anonymous users2024-02-01

    #include ""

    void main()

    a[0][0]=1;

    int i,j;

    for(i=1;i<=9;i++) if(a[i][j]!) from 1=0) is zero and does not output.

    printf("%d ",a[i][j]);printf("");

    return 0;}

  6. Anonymous users2024-01-31

    The function main is declared void

    So there shouldn't be a renturn 0;

    If else typography is also incorrect.

    It should be used as much as possible.

    if (.else

    Array A is also not initialized in the right way.

  7. Anonymous users2024-01-30

    if(i=j) printf("");The equals of this line should be judged by two equal signs.

    Also, you don't assign a boundary of 1 to j==0 and i==j

    Then, it seems that if(i=j) printf("");The output return is also not needed.

  8. Anonymous users2024-01-29

    They lie to you, give it to me.

    #include

    void main()

    while(n<1 ||n>16)

    for(i=1;i<=n;i++)

    printf("");}

  9. Anonymous users2024-01-28

    The first loop there should be added:

    for(i=0;i<=9;i++)

  10. Anonymous users2024-01-27

    First of all, you didn't use the recursive implementation, and secondly, your program was wrong.

Related questions
7 answers2024-02-09

2000 can't be used.

It is best to change the power supply, the conversion rate of the miscellaneous power supply is poor, and the cost of electricity is not good for the hardware. >>>More

18 answers2024-02-09

There are high, medium and low end in each part. It's up to you how you match. >>>More

10 answers2024-02-09

I'm a computer professional.,According to my own knowledge,I'll explain the hardware you said.,First of all,Your CPU is not produced by Intel manufacturers.,It should be produced by Intel authorized manufacturers.,Please see the icon.。 >>>More

3 answers2024-02-09

Don't be obsessed with fortune tellers. That's just a legend. There is no value for any accuracy. >>>More

6 answers2024-02-09

The results of this test alone do not explain anything, and must be judged in combination with actual physical signs. Not to mention the cause of the disease and the best plan. >>>More