经典简约
清爽简洁,回归本真
液态水晶
毛玻璃+霓虹光带
赛博朋克
霓虹故障艺术风
🚫
违规操作检测
禁止使用右键菜单
⚠️ 此操作已被系统记录
1

【数组】杨辉三角形(例题)

📝 题解 🔵 仅限 C++
题目描述
<p> &nbsp;<strong>&nbsp;&nbsp; 例5.11</strong> &nbsp;&nbsp; 打印杨辉三角形的前10行。杨辉三角形如下图: </p> <p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 </p> <p> &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;1 &nbsp; 1 </p> <p> &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 &nbsp; 2 &nbsp; 1 </p> <p> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 &nbsp; 3 &nbsp; 3 &nbsp; 1 </p> <p>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 &nbsp; 4 &nbsp; 6 &nbsp; 4 &nbsp; 1 </p>
输入格式
&nbsp;&nbsp;&nbsp; 无输入。<br />
输出格式
&nbsp;&nbsp;&nbsp; 杨辉三角形前10行,输出格式见样例输出(无需修改教材程序,体会setw()语句作用)。<br />
样例
样例输入 1
no input needed
样例输出 1
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 1 9 36 84 126 126 84 36 9 1
提交代码
请先登录后提交

🤖 AI 解题助手

DeepSeek
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这道题,可以帮你分析思路、提供代码示例。
⚠️ 请先登录后使用