我发现以下任务令人困惑,因为我不熟悉编写代码。请帮忙 [英] I find the following task confusing as I am new to writing code. Please help

查看:87
本文介绍了我发现以下任务令人困惑,因为我不熟悉编写代码。请帮忙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编写一个执行以下步骤的程序:





•将您选择的数量存储在一个名为<<的变量中br />
•将a的值复制到另一个名为b

的变量中•使用printf()语句显示当前存储在a和b中的值

•再次显示a和b的值,但这次在printf()语句中使用++和++ b(而不是简单的a和b)。

(请注意,++来自a之后,之前是b。)

•再次显示a和b的值



我尝试了什么:



我还没有尝试过任何东西,因为我不熟悉编码和我很沮丧这个任务。

Write a program that carries out the following steps:


•stores a number of your choice in a variable called a
•copies the value of a into another variable called b
•displays the values currently stored in a and b using a printf() statement
•displays the values of a and b again, but this time use a++ and ++b (instead of just plain a and b) in the printf() statement.
(Note that the ++ comes After the a, and Before the b.)
•displays the values of a and b once more

What I have tried:

I have not tried anything yet as I am new to coding and am frustrated with this task.

推荐答案

这是非常(非常)基本的东西:使用 Google 找出关于 C 语言编程。
That's very (very) basic stuff: use Google to find out tutorials on C language programming.


停止给出借口,这是一个非常基础和简单的练习,可以帮助您开始使用C编程。

C教程 [ ^ ],这两章将有所帮助:

1. C变量 [ ^ ]

2. C操作员 [ ^ ]
Stop giving excuses, this is very very basic and simple exercise to get you started with C programming.
Study and do it yourself at C Tutorial[^] , these 2 chapters will help:
1. C Variables[^]
2. C Operators[^]


这并不困难:这是你刚刚在课程中介绍的所有基本内容,我敢肯定。

人们必须编写的第一个程序通常是Hello World - 所以我相信你已经写过类似的东西:

This isn't difficult: it's all the basic stuff you just covered in your lesson, I'm sure.
The first program people have to write is normally "Hello World" - so I'm sure you have already written something like this:
#include <stdio.h>

int main()
    {
    printf("Hello, World!\n");
    return 0;
    }

所以请停止恐慌,仔细阅读说明 - 它们非常明确!

从你的Hello world程序开始,然后改变它,依次做每一步 - 我会为你做第一个,其余的由你决定:

So stop panicking, and read the instructions carefully - they are very explicit!
Start with your "Hello world" program, and change it do do each step in turn - I'll do the first one for you, and the rest are up to you:

stores a number of your choice in a variable called a

的变量中


#include <stdio.h>

int main()
    {
    int a;
    a = 666;
    return 0;
    }

那里!完成!那么难吗?

现在继续尝试下一个 - 就这么简单!

There! Done! Was that so difficult?
Now get on and try the next one - it is just as simple!


这篇关于我发现以下任务令人困惑,因为我不熟悉编写代码。请帮忙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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