博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
第10周上机实践项目5——输出完数
阅读量:2344 次
发布时间:2019-05-10

本文共 353 字,大约阅读时间需要 1 分钟。

问题及代码

/* * Copyright (c) 2014, 烟台大学计算机学院 * All rights reserved. * 文件名称:test.cpp * 作    者:辛彬 * 完成日期:2014年 11 月 5 日 * 版 本 号:v1.0 * * 问题描述:找出1000以内的完数。 * 输入描述:没有输入。 * 程序输出:1000以内的完数。 */#include 
using namespace std;int main(){ int a,i,m; for(a=2; a<=1000; a++) { m=0; for(i=1; i

运行结果:

学习感悟:中途搞错了几次,发现是定义变量发生了混乱,以后尽量用自己熟悉的名称。

你可能感兴趣的文章
关于html_entity_decode、空格 以及乱码
查看>>
Box2d no gravity
查看>>
mario collision
查看>>
tiled 地图工具
查看>>
小游戏
查看>>
旋转关节绳子
查看>>
射箭box2d
查看>>
cocos2d iphone-wax cocowax
查看>>
angribird level editor
查看>>
love2d 苹果运行
查看>>
GridBagLayout 的注意
查看>>
ajax 跨域iis6 设置
查看>>
4.0版本改动
查看>>
IE8 9 ajax no-transport ajax 问题
查看>>
oracle 启动dbconsole
查看>>
entity-framework 6解决方案中多个项目使用
查看>>
ios基础
查看>>
unity3d
查看>>
metronic 1.5
查看>>
unity3d 4 assert store
查看>>