infinite-loop

    -5热度

    2回答

    嗨,我的教官问我编写了一个代码,可以获得一个学生的3个年级的平均值,并输出一个特定的字符串,每个区间的平均值为 (例如,如果AVG​​ b/w 70 cout < <“优秀\ n”;)但是有一个条件,在这种情况下,对于学生错过三个测试中的一个来说,没有问题 。我一直在调整 小时,我不知道如何创建两个条件(两个差异eqns>平均值(如果你错过了一个测试,其他如果你不这样做) 也不知道如何以创建循环,

    -1热度

    5回答

    x=0 y=0 while 1==1: while y!=5: y=y+1 print(str(x) + str(y)) else: x=x+1 #NOW GO TO WHILE 1==1 AND DO THAT AGAIN 此代码应该打印01; 02; 03; 04; 05然后它应该打印11; 12; 13; 1

    0热度

    1回答

    我在Python 3.6.0上编写了下面的代码来找到Spyder编辑器上的立方体根。 #Finding the cube root #import math y=input("Enter a number whose cube root you want to find: ") root=float(y) #x1=math.pow(root,1/3)

    -9热度

    1回答

    我试图在getCommand函数中使用while(1)循环,但它运行无限且不会中断。我已经包含了HELP函数,因为它在getCommand函数中被调用。这是有问题的代码: void HELP(string inCommand) { if (inCommand == "invLoad?") cout << "This command allows the user to loa

    0热度

    4回答

    我有一个简单的C语言电话簿,它将输入信息保存到我的电脑上的文本文件中。 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdbool.h> void validateName(char name[], FILE *fptr); void validateI

    1热度

    1回答

    我正在写一个简单的bash脚本来从文本文件中读取文件名并检查它们是否存在于目录中。虽然这工作正常,所有文件解析后,我陷入了无限循环。 #!/bin/bash if [ "$1" = "" ]; then echo "No input file to parse given. Give me an input file and make sure the corresponding .

    0热度

    1回答

    我有以下脚本,但它永远不会结束执行。 可能是什么问题?我试图调试它,但显然它可以正确使用单个文件,但是当我将它扔到内容充满内容的文件夹失败时。 $path = split-path -parent $MyInvocation.MyCommand.Definition $files = Get-ChildItem "$path\CodeForCertification\5_SourceCode\*

    0热度

    2回答

    我的路线是这样的: render( <Provider store={store}> <Router history={history}> <Route path="/" component={App}> <IndexRoute component={SEOModuleComponent} onEnter={(nextState, replace) =>

    1热度

    2回答

    我一直在努力,以创造和的OpenWRT无限循环,我已经成功了: #!/bin/sh /etc/rc.common while [ true ] do # Code to run sleep 15 done 此代码的工作作为挂饰,如果我执行它。/脚本。但是,当我打开路由器时,我希望它自己开始。我已将该脚本放入/etc/init.d并通过chmod +x script启用

    1热度

    1回答

    我在Haskell,在那里我有一条线,确实是这样写的一段代码: addElement :: [a] -> a -> [a] addElement list elem = list ++ [elem] 我需要(或者至少,我是这样认为的),这样的功能对于增加的目的我正在实现的图形数据结构的顶点列表中的新顶点。现在,我可以这样称呼这个功能 newlist = addElement oldlist