写下面的C ++程序的输出? [英] Write the output of the following C++ program?

查看:80
本文介绍了写下面的C ++程序的输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意:假设所有必需的头文件已包含在程序中。



Note: Assume all required header files are already included in the program.

typedef	char TEXT[80];

void JumbleUp(TEXT T)
{
    int L=strlen(T);
    for (int C=0; C<L-1; C+=2)
    {
        char CT=T[C];

        T[C]=T[C+1];
        T[C+1]=CT;
    }

    for (C=1; C<L; C+=2)
        if (T[C]>=’M’ && T[C]<=’U’)
            T[C]=’@’;
}

void main()
{
    TEXT Str="HARMONIOUS";
    JumbleUp(Str);

    cout<<Str<<end1;
}





我的尝试:



我解决了程序,但第二个循环我无法理解。答案是-AHM @ N @ OIS @





Plz邮寄给我 - [EMAIL REMOVED]带有第二个循环的解释。



提前谢谢



What I have tried:

I solved the program but the second loop i cannot understand. The answer is -AHM@N@OIS@


Plz mail me on - [EMAIL REMOVED] with the explanation of the second loop.

Thanks in advance

推荐答案

我们不做你的作业:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是和你想的一样困难!



如果遇到具体问题,请询问相关问题,我们会尽力提供帮助。但我们不打算为你做这一切!



尝试使用调试器,看看你是否可以按照正在发生的事情......
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!

Try using the debugger and see if you can follow what is going on...


引用:

我解决了程序,但第二个循环我无法理解。答案是-AHM @ N @ OIS @

I solved the program but the second loop i cannot understand. The answer is -AHM@N@OIS@



调试器将帮助您理解代码。

当您不明白您的代码是什么时做或为什么它做它做的,答案是调试器

使用调试器来查看你的代码在做什么。只需设置断点并查看代码执行情况,调试器允许您逐行执行第1行并在执行时检查变量,这是一个令人难以置信的学习工具。



调试器 - 维基百科,免费的百科全书 [ ^ ]

掌握Visual Studio 2010中的调试 - 初学者指南 [ ^ ]

使用Visual Studio 2010进行基本调试 - YouTube [ ^ ]



调试器在这里向您展示您的代码在做什么你的任务是与它应该做的事情进行比较。

调试器中没有魔法,它没有发现错误,它只是帮助你。当代码没有达到预期效果时,你就接近了一个错误。




The debugger will help you ti understand the code.
When you don't understand what your code is doing or why it does what it does, the answer is debugger.
Use the debugger to see what your code is doing. Just set a breakpoint and see your code performing, the debugger allow you to execute lines 1 by 1 and to inspect variables as it execute, it is an incredible learning tool.

Debugger - Wikipedia, the free encyclopedia[^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]
Basic Debugging with Visual Studio 2010 - YouTube[^]

The debugger is here to show you what your code is doing and your task is to compare with what it should do.
There is no magic in the debugger, it don't find bugs, it just help you to. When the code don't do what is expected, you are close to a bug.

引用:

编写以下C ++程序的输出?

Write the output of the following C++ program?



我们不做你的HomeWork。

HomeWork不会测试你的技能在请求其他人做你的工作时,它会让你思考并帮助你的老师检查你对所学课程的理解,以及你应用它们时遇到的问题。

你的任何失败都会帮助你的老师发现你的弱点并设定补救措施。

所以,试一试,重读你的课程并开始工作。如果您遇到特定问题,请显示您的代码并解释这个问题,我们可能会提供帮助。



作为程序员,您的工作是创建算法解决特定问题,你不能依赖别人永远为你做,所以有一段时间你必须学会​​如何。而且越快越好。

当你要求解决方案时,就像试图通过培训其他人来学习开车一样。

创建算法基本上是找到数学并做出必要的调整以适应你的实际问题。


We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.

As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better.
When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.


这篇关于写下面的C ++程序的输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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