C++ 第六讲_数组与字符串(二).pptVIP

  • 3
  • 0
  • 约9.83千字
  • 约 35页
  • 2017-08-15 发布于江西
  • 举报
C++ 第六讲_数组与字符串(二).ppt

7 《C++语言及编程技巧》 第6讲 数组与字符串(续) 第6讲 数组(二) 2.2 多维数组(续) 2.3 字符数组与字符串 2.4 小结与程序设计示例 3.2 多维数组 例21 承例13,使用二维数组求解杨辉三角形问题。 分析 图示形式 3.2 多维数组 // program YangHui2.cpp using two-dimensional array #include iostream.h #include iomanip.h void main() { const int MAX=12; const char BRANK=‘’; int i,j,n; int a[MAX+1][MAX+1]; do { coutEnter n(1=n=“MAX“): ; cinn; } while (!(n=1n=MAX)); for (i=0;i=n;i++) { a[i][0]=1; a[i][i]=1; for (j=1;j=i-1;j++) a[i][j]=a[i-1][j-1]+a[i-1][j]; for (j=1;j=3*(MAX-i)+1;j++) coutBRANK; for (j=0;j=i;j++) coutsetw(6)a[i][j

文档评论(0)

1亿VIP精品文档

相关文档