RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

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

Максим Филимонов's questions

Martin Hope
Максим Филимонов
Asked: 2022-04-11 00:52:12 +0000 UTC

将矩阵划分为子矩阵

  • 0

输入 N - 矩阵的大小,K - 子矩阵的大小。
接下来引入一个矩阵
Let N = 3, K = 2

我们的 N*N 矩阵

1 2 1
1 1 2
1 1 1

所有大小为 K*K 的子矩阵:

[1 2
 1 1]

[2 1
 1 2]

[1 1
 1 1]

[1 2
 1 1]

如何对子矩阵进行相同的发现?从什么推回来?他唯一做的就是创建一个由 k*k 矩阵组成的三维数组,其中填充了零。

python
  • 2 个回答
  • 10 Views
Martin Hope
Максим Филимонов
Asked: 2022-05-08 17:31:26 +0000 UTC

帕斯卡代码不起作用

  • 0
var n, c, i, x: integer;
begin 
 readln(n);
 c := 0;
 for i := 1 to n do
    readln(x);
    if ((x >= 100) and (x <= 999) and (x div 100 = 3) and (x mod 5 = 0)) then c := c + 1;
 writeln(c);
end.

它必须从长度为 n 的序列中找到以 3 开头且可被 5 整除的三位数字的个数。

pascal
  • 2 个回答
  • 10 Views
Martin Hope
Максим Филимонов
Asked: 2022-03-20 21:12:26 +0000 UTC

手动在 C++ 中堆栈

  • 1
#include <iostream>
#include <algorithm>

using namespace std;

struct vector {
    vector *nextElem;
    int ans;
    int length;
    vector(int n) {
        this->ans = 0;
        vector *next = nextElem;
        for (int i=0; i<=n; i++){
            next->ans=0;
            next=next->nextElem;
        }
        length = n;
     }
     vector(int n, int val) {
        this->ans = val;
        vector *next = nextElem;
        for (int i=0; i<=n; i++){
            next->ans=val;
            next=next->nextElem;
         }
         length = n;
     }
     void push_back(int val) {
         vector *next = nextElem;
         for (int i = 1; i < length; i++) {
               next=next->nextElem;
         }
         length++;
         next->ans = val;
     }
     void pop_back() {
         vector *next = nextElem;
         for (int i = 0; i < length; i++) {
               next=next->nextElem;
         }
         length--;
         next->nextElem=0;
     }
    int get(int i) {
       vector *next = nextElem;
       if (i > 0) {
            for (int j = 1; j < i; j++) {
                   next=next->nextElem;
            }
        return next->ans;
       } else return ans;
    }
    int size() {
        return length;
    }
};





int main() {
    vector *v;
    v = new vector(2, 10);
    v->push_back(0);
    std::cout << v->size() << std::endl; // 3
    std::cout << v->get(2) << std::endl; // 0
    std::cout << v->get(1) << std::endl; // 10
    std::cout << std::endl;
    v->pop_back();
    v->pop_back();
    std::cout << v->size() << std::endl; // 1
    std::cout << std::endl;
    v->push_back(5);
    v->push_back(17);
    v->push_back(3);
    std::cout << v->get(0) << std::endl; // 10
    std::cout << v->get(1) << std::endl; // 5
    std::cout << v->get(3) << std::endl; // 3
    std::cout << v->size() << std::endl; // 4
}

带一个参数的构造函数会创建一个包含 n 个元素的堆栈,其值为 0;有两个参数 - 值为 val。push_back 和 pop_back 方法在堆栈上创建和删除元素。get方法通过i参数返回元素的值,size也返回序列中元素的个数。项目计数从 0 开始。

一切似乎都运行良好,但执行后,Code::Blocks 显示消息Process returned -1073741571 (0xC00000FD) execution time : 1.473 s。帮助

c++
  • 1 个回答
  • 10 Views
Martin Hope
Максим Филимонов
Asked: 2022-03-20 03:41:37 +0000 UTC

从秒转换为天、小时、分钟和秒

  • 0
struct my_time {
    long long day, hour, minute, second;
    void set(long long t) {
        if (t>=0) {
            day = t/60/60/24;   
            hour = t/60/60-day*24;
            minute = t/60-hour*60-day*24*60;
            second = t-minute*60-hour*60*60-day*60*60*24;
        } else if (t%86400==0) {
            day=t/86400;
            hour=0;
            minute=0;
            second=0;
        } else  {
            day = -1;
            day += t/86400;
            hour = abs(t/60/60-24*day-1);
            minute = abs(t/60-hour*60-24*60*day-1);
            second = (abs(t-minute*60-hour*60*60-60*60*24*day-1)+1)%60;
        }
    }
};

需要写一个时间结构体,set方法接收以秒为单位的秒数作为参数。当我进入方法时出现错误,例如-600。这些字段等于-1 23 49 0,但它们应该是-1 23 50 0。告诉我问题出在哪里。

c++
  • 2 个回答
  • 10 Views
Martin Hope
Максим Филимонов
Asked: 2022-03-15 23:28:10 +0000 UTC

重新排列数组中的数字

  • 0
#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    long long arr1[n];
    for (int i = 0; i < n; i++) {
        cin >> arr1[i];
    }
    for (int i = 0; i < n; i++) {
        for (int k = i; k < n; k++) {
            if (arr1[k] % 2 == 0) {
                long long t = arr1[k];
                arr1[k] = arr1[i];
                arr1[i] = t;
            }
        }
        cout << arr1[i] << " ";
    }
}

有必要重新排列数组中的偶数和奇数,使偶数在开头,奇数仅在它们之后。必须保持顺序

数字已重新排列,但顺序未保留,请帮助

c++
  • 3 个回答
  • 10 Views
Martin Hope
Максим Филимонов
Asked: 2020-05-28 20:23:19 +0000 UTC

如何将 <div> 的长度设置为浏览器窗口大小的四分之一?

  • 1

如何将长度设置<div>为浏览器窗口长度的四分之一?

javascript
  • 2 个回答
  • 10 Views
Martin Hope
Максим Филимонов
Asked: 2020-04-08 19:35:42 +0000 UTC

代码中的错误是什么?运行时错误:输入字符串格式不正确。您需要输入一个数字,整数部分为 3 位,小数部分为 4 位

  • 0
var x, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11: integer;
begin
read(x);
x1 := trunc(x);
x2 := x1 div 100;
x3 := x1 div 10 mod 10;
x4 := x1 mod 10;
x5 := x2 + x3 + x4;
x6 := x - x1;
x7 := x6 div 1000;
x8 := x6 div 100 mod 10;
x9 := x6 div 10 mod 10;
x10 := x6 mod 10;
x11 := x7 + x8 + x9 + x10;
writeln(x5);
writeln(x11);
end.
pascal
  • 1 个回答
  • 10 Views
Martin Hope
Максим Филимонов
Asked: 2020-03-29 20:07:19 +0000 UTC

如何水平排列未分配的列表?

  • 0

ul.topmenu {
  margin: 0px;
  padding: 4px;
  text-decoration: none;
}

ul.topmenu li {
  position: relative;
  margin-top: 70px;
  margin-left: 829px;
  display: inline;
  height: 13px;
  width: 416px;
  font-size: 16px;
  line-height: 18px;
  text-transform: uppercase;
  margin-right: 0px;
  padding: 0;
  flex-wrap: nowrap;
  text-decoration: none;
  text-align: center;
}

.topmenu a {
  text-decoration: none;
  color: white;
  padding: 5px 15px;
  text-align: center;
  margin-right:
}
<img id="background1" src="background1.png">
<img id="logo1" src="logo1.png">
<ul class="topmenu">
  <li><a href="#">home</a></li>
  <li><a href="#">about</a></li>
  <li><a href="#">work</a></li>
  <li><a href="#">blog</a></li>
  <li><a href="#">contact</a></li>
</ul>

html
  • 1 个回答
  • 10 Views
Martin Hope
Максим Филимонов
Asked: 2020-03-27 18:27:01 +0000 UTC

<Input> 移动图片

  • 1

使用时与<input>图片一起移动margin。怎么才能动<input>?

#fullnameinput {
  height: 46px;
  width: 281px;
  background-color: rgba(255, 255, 255, 1);
  border-radius: 2px 2px 2px 2px;
  font-size: 13px;
  background-image: url(48.png);
  background-repeat: no-repeat;
  background-position: 4px;
  outline: none;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  padding-left: 20px;
  margin-top: 289px;
  margin-left: 306px;
  border: none;
  position: relative;
}
<header>
  <div id="logo1"><img src="888.png"></div>
  <nav>
    <div id="menu">
      <a class="menu__item" href="">HOME</a>
      <a class="menu__item" href="">SERVICE</a>
      <a class="menu__item" href="">ABOUT US</a>
      <a class="menu__item" href="">PRICING TABLE</a>
      <a class="menu__item" href="">HOW IT WORK</a>
      <a class="menu__item" href="">HAPPY CLIENTS</a>
      <a class="menu__item" href="">CONTACT US</a>
    </div>
  </nav>
</header>
<div id="banner12345">
  <p id="mainheader"><strong>BOOST UP YOUR LOCAL BUSINESS</strong></p>
  <p id="maintext">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum typesetting.</p>
  <input placeholder="    Full Name" id="fullnameinput" type="text" name="Full Name">

  <img id="bannerpng" width="100%" src="20.png">

</div>

html
  • 1 个回答
  • 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