Classic
Clean & simple
Crystal
Glassmorphism + Neon
Cyberpunk
Neon glitch art
🚫
违规Action检测
禁止Use右键菜单
⚠️ 此Action已被系统记录
1

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

📝 Solutions 🔵 仅限 C++
Problems Description
<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>
Input格式
&nbsp;&nbsp;&nbsp; 无输入。<br />
Output格式
&nbsp;&nbsp;&nbsp; 杨辉三角形前10行,输出格式见样例输出(无需修改教材程序,体会setw()语句作用)。<br />
Sample
Sample Input 1
no input needed
Sample Output 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
Submit Code
请先Login后Submit

🤖 AI 解题助手

OpenRouter
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这problems题,可以帮你points析思路、提供Code示例。
🔓 完全Free · 无需消耗 Token