#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args) {
} String ^ strSpace = " "; Console::Write(strSpace->PadLeft((n - i) * 3)); for each(int data in nextLineArr)Console::Write("{0,6}", data); Console::WriteLine(); curLineArr = nextLineArr;} int n; Console::Write("请输入杨辉三角的阶数:"); n = Int32::Parse(Console::ReadLine()); array<int>^curLineArr = nullptr; for (int i = 0; i < n; i++) { array<int>^nextLineArr = gcnew array<int>(i + 1); if (i <=1) { } else if (curLineArr->Length>1) { nextLineArr[0] = 1; for (int k = 0; k < curLineArr->Length - 1; k++) { } nextLineArr[nextLineArr->Length - 1] = 1; nextLineArr[k + 1] = curLineArr[k] + curLineArr[k + 1];for (int j = 0; j < i + 1; j++)nextLineArr[j] = 1;{
} } return 0;
www.99jianzhu.com/包含内容:建筑图纸、PDF/word/ppt 流程,表格,案例,最新,免费下载,施工方案、工程书籍、建筑论文、合同表格、标准规范、CAD图纸等内容。