RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题

全部问题

Martin Hope
Andorey Rich
Asked: 2020-05-27 01:13:20 +0000 UTC

如何从任何其他六位数字中生成数字 100

  • 12

请告诉我如何构建一个算法来处理一个六位数的数字,以便可以通过数学运算找出它所包含的数字是否为100?
示例:
050500 ---> (0 + 50 + 50 + 0) == 100
595545 ---> (5 + ((9 * 5) + (5 + 45))) = 100
093342 ---> (0 + ((9 / (3 / 34)) - 2)) = 100
231357 ---> (2 - (3 * (((1 / 3) - 5) * 7))) = 100
...
我发现一篇关于 Habr 的文章 ( https://habr.com/ru/post/339654/ ),其中给出了一个类似的例子。

将 6 位数字转换为数字数组不是问题。
例如:a = 123456;
然后 String(a).split('').map(e => +e) // 输出 ---> [1,2,3,4,5,6]

但是如何进一步排列符号(+,-,/,*)并正确放置括号,这辈子我都想不起来:(我已经为这个任务苦苦挣扎了一个月。我想按照 Habr 的文章中描述的那样做(见上文),但我不知道如何在 java 脚本中实现这一点,甚至有可能在 JS 中创建这样的“动态”公式,还是你需要事先为动作指定模板,然后在其中替换数字???

请给我一个思考的方向。

javascript
  • 3 个回答
  • 10 Views
Martin Hope
user380202
Asked: 2020-04-12 21:44:49 +0000 UTC

球从方块边界的边缘反弹?

  • 12

父块中有一个球:

body {
  background: black;
}

.box {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  width: 500px;
  height: 300px;
  border-radius: 5px;
  box-shadow: inset 0 0 2px black;
  background-color: white;
}

.ball {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 100%;
  background-color: black;
  box-shadow: inset -5px -5px 5px rgba(0, 0, 0, .5), 15px 15px 2px rgba(0, 0, 0, .05);
}
<div class="box">
  <div class="ball"></div>
</div>

我怎样才能让它无限期地移动并从这个块的边界边缘反弹?

javascript
  • 3 个回答
  • 10 Views
Martin Hope
finally
Asked: 2020-11-20 05:54:22 +0000 UTC

[:] 和 .copy() 有什么区别?

  • 12

面对这样的情况,有一个清单:

a = [1, 2, 3]

我想得到它的副本,使新的переменную唯一,这样它就不会引用旧的地址。我知道两个本质上做同样事情的结构:

b = a[:]

和

b = a.copy()

它们都是正确的,并且会给出相同的结果,但是它们之间有根本的区别吗?

python
  • 1 个回答
  • 10 Views
Martin Hope
NaN
Asked: 2020-11-13 16:15:14 +0000 UTC

C++中函数前的双冒号

  • 12

双冒号操作称为范围解析操作。当我们编写时::func()(运算符左侧没有任何内容),我们是否限定了全局命名空间的范围?做什么的?

c++
  • 2 个回答
  • 10 Views
Martin Hope
Andrew Gor
Asked: 2020-09-25 18:53:59 +0000 UTC

根据 SVG 下的图像颜色自动更改 SVG 颜色

  • 12

在svg中有一个徽标。

我需要根据徽标下的主色将徽标的颜色更改为白色或黑色。

我试图为此目的使用插件BackgroundCheck。在一个干净的html插件中,它可以工作,但是当我加载它时Тильду,它就不起作用了。

在我看来,我的风格被忽视了。我究竟做错了什么?

<!--logo-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<html>

<head>
  <style type="text/css" media="screen">
    .images {
      width: 100%;
      display: block;
    }
    
    .fixed-nav {
      /* 	background-color: red; */
      position: fixed;
      left: 100px;
      top: 47px;
      width: 80px;
      z-index: 99999;
    }
    
    .fixed-nav.background--dark .fixed-nav-line {
      /*   background: #fff; */
    }
    
    .fixed-nav.background--dark .fixed-nav-logo {
      background-image: url(https://static.tildacdn.com/tild3831-3566-4637-b934-383138346332/Awhite.svg);
      height: 43px;
      width: 33px;
      /* 		fill: white; */
      /*   color: #fff; */
    }
    
    .fixed-nav.background--light .fixed-nav-logo {
      background-image: url(https://static.tildacdn.com/tild6133-3534-4237-b863-666531326632/A.svg);
      height: 43px;
      width: 33px;
    }
    
    .fixed-nav-line,
    .fixed-nav-logo {
      background-image: url(https://static.tildacdn.com/tild6133-3534-4237-b863-666531326632/A.svg);
      display: inline-block;
      vertical-align: middle;
      margin: 0;
      padding: 0;
    }
    
    .fixed-nav-line {
      width: 40px;
      height: 3px;
      background: #222;
    }
    
    .fixed-nav-logo {
      /* 	background-color: yellow; */
      width: 33px;
      height: 43px;
      font-size: 28px;
      font-weight: bold;
      text-align: center;
      z-index: 99999;
    }
  </style>
  <script src="https://hosting.maass.ua/background-check.min.js"></script>
  <script src="https://hosting.maass.ua/fixed-nav.js"></script>
</head>

<body>
  <!--<div class="fixed">-->
  <div class="fixed-nav">
    <a href="#">
      <div class="fixed-nav-logo"></div>
    </a>
  </div>
  <!--</div> -->
  <div class="images">
    <img class="images" src="https://static.tildacdn.com/tild6361-3535-4136-a662-353763663866/12049949b04d4882bcdf.jpg" />
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <img class="images" src="https://static.tildacdn.com/tild3837-6362-4139-b933-616635623530/maass-RO-hall-30.jpg" />
  </div>
</body>

</html>

PS也许还有其他方法可以解决我的问题?

提前致谢。

javascript
  • 4 个回答
  • 10 Views
上一页
下一页

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5