本文介绍了有人可以解决这个程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞!The Problem is that i should be able to get an output of this "wrong" program in an online compiler, but i can not seem to make it work.On the verge of giving up to find the solution so i thought i'd post the question here,So basically, the program should manipulate the characters " Comp@uter! " using the isalpha() and isupper() function on C++ and give the proper output , so can someone please help me out, if not for running online can anyone give me an answer on this?will be realy helpful if each line is explained after the 3rd line,Please no hate, I'm not a computer programmer.#include<iostream.h>#include<ctype.h>void main( ){ char Text[ ] = "Comp@uter!";for(int I=0; Text[I]!=‟\0‟;I++){ if(!isalpha(Text[I]))Text[I]=‟*‟;else if(isupper(Text[I]))Text[I]=Text[I]+1;elseText[I] = Text[I+1]; }cout<<Text; } 我尝试过: 尝试在线运行不起作用What I have tried:Tried running online doesn't work推荐答案首先,您需要学习如何格式化代码并使用缩进,它确实有助于阅读代码和理解它。First thing, you need to learn how to format your code and use indentation, it really help for reading the code and understand it.#include<iostream.h>#include<ctype.h>void main( ){char Text[ ] = "Comp@uter!";for(int I=0; Text[I]!=‟\0‟;I++){if(!isalpha(Text[I]))Text[I]=‟*‟;else if(isupper(Text[I]))Text[I]=Text[I]+1;elseText[I] = Text[I+1];}cout<<Text;}引用:请不要讨厌,我不是一个计算机程序员。Please no hate, I'm not a computer programmer. 这里没有人讨厌,我们都是初学者。如果我们不只是给出答案,那是因为我们从经验中知道这是最糟糕的事情,它不能帮助你学习编程。No hate here, we were all beginner once. If we don't just give the answer, it is because we know from experience that it is the worst thing to do, it don't help you to learn programming.引用:尝试在线运行不起作用 这不是提供信息,问问题也是一种通缉技巧。尝试提供错误消息和位置等信息。 纠正编译器错误后,您可以使用调试器,它是一个允许您查看程序的工具执行。 当你不明白你的代码在做什么或为什么它做它的作用时,答案是调试器。 使用调试器,看看你的代码在做什么。只需设置断点并查看代码执行情况,调试器允许您逐行执行第1行并在执行时检查变量,这是一个令人难以置信的学习工具。 调试器 - 维基百科,免费的百科全书 [ ^ ] 掌握Visual Studio 2010中的调试 - 初学者指南 [ ^ ] 调试器在这里显示你的代码正在做什么,你的任务是与它应该做什么进行比较。 调试器中没有魔法,它没有发现错误,它只是帮助你。当代码没有达到预期的效果时,你就会接近一个错误。This is not informative, asking question is also a wanted skill. Try to give informations like error messages and positions.Once compiler errors are corrected, you can use the debugger, it is a tool that will allow you to see the program executing.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[^]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. 这篇关于有人可以解决这个程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-18 09:31