我怎么开始这个伪code [英] how do I start this pseudocode

查看:455
本文介绍了我怎么开始这个伪code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好,我很失落,现在这个任务,只是需要一些帮助。

的分配是设​​计一个程序,生成数字的总和。

给出一个数(用户输入),你需要将产生数的总和从1到给定的数字我只是需要一些帮助启动,因为我只是有硬的时间提出的申请,我知道那可能看似容易,但从来没有任何经验,任何这在所有。

解决方案

 变种输入= getUserInput;
VAR总和;

而(输入&0)
{
  总和=总和+ input--;
}

打印总和;
 

ok I am lost right now by this assignment and just need some help.

The assignment is Design a program that generates the sum of numbers.

Given a number (user input) you need an application that will produce a sum of the numbers from 1 to that given number I just need some help to start because I am just having to hard of a time and i know it might seem easy but never had any experience to any of this at all.

解决方案

var input = getUserInput;
var sum;

while (input > 0)
{
  sum = sum + input--;
}

print sum;

这篇关于我怎么开始这个伪code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆