#include\x20 using\x20namespace\x20std;

int\x20main()\x20{ \x20\x20int\x20n; \x20\x20cin\x20>>\x20n;\x20//\x20输入行数 \x20\x20int\x20sum\x20=\x200; \x20\x20for\x20(int\x20i\x20=\x201;\x20i\x20<=\x20n;\x20i++)\x20{ \x20\x20\x20\x20for\x20(int\x20j\x20=\x201;\x20j\x20<=\x20i;\x20j++)\x20{ \x20\x20\x20\x20\x20\x20sum\x20+=\x20j;\x20//\x20将每行数字累加到总和中 \x20\x20\x20\x20} \x20\x20} \x20\x20cout\x20<<\x20sum\x20<<\x20endl;\x20//\x20输出总和 \x20\x20return\x200; }

C++ 计算机关数字总和 - 编程实现

原文地址: https://www.cveoy.top/t/topic/p4Xv 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录