网站首页 站内搜索

搜索结果

查询Tags标签: std,共有 1098条记录
  • MFC表达式计算器

    MFC表达式计算器 《mfc表达式计算器》 该程序应该是一个mfc窗口程序,应该基于对话框。 1、支持基本运算符:括号()、+,-,*,/。 2、支持复杂运算符:三角函数-sin(x)/cos(x)/tan(x)/atan(x)、对数-ln(x)/log(x)、开方sqrt(x),乘方xx,x2,阶乘n!。 3.有可以直接利用进…

    2022/8/30 6:25:01 人评论 次浏览
  • C++各个版本新增对于算法竞赛有用特性

    C++各个版本新增对于算法有用特性 C++11 auto与decltype类型推导(摘自程序喵大人) auto auto可以让编译器在编译器就推导出变量的类型,话不多说上代码: auto a = 10; // 10是int型,可以自动推导出a是int int i = 10;auto b = i; // b是int型 auto d = 2.0; // d是dou…

    2022/8/30 1:23:07 人评论 次浏览
  • ERROR: <bits/stdc++.h>, 'cstdalign' file not found, running C++17

    Modified 1 year, 1 month ago Viewed 9k times4Im trying to run a piece of code in Visual Studio Code, on macOS Catalina. The code: #include <bits/stdc++.h> using namespace std;int main() { // Create an empty vector vector<int> vect; vect.…

    2022/8/29 14:22:59 人评论 次浏览
  • c++ bind ref 例子

    // bind example #include <iostream> // std::cout #include <functional> // std::bind// a function: (also works with function object: std::divides<double> my_divide;) double my_divide (double x, double y) {return x/y;}struct MyPa…

    2022/8/28 14:22:56 人评论 次浏览
  • 统计分析 -- 聚类算法模型

    统计分析 -- 聚类算法模型 距离分析数据标准化 欧氏距离与量纲有关,因此,有时需要对数据进行预处理, 如标准化等。 在MATLAB中的命令是zscore,调用格式 Z = zscore(X) 输入X表示N行p列的原始观测矩阵,行为个体,列为指标。输出Z为X的标准化矩阵: Z = (X–ones(N,1)*m…

    2022/8/24 1:22:52 人评论 次浏览
  • 2022.8.22 颓废记录

    Preface 没有序言 Content [luogu P4059][Code+#1]找爸爸题面太长难以概括,不写简要题目了QAQ。首先发现,肯定没有两个对应位置都是空格的,否则可以去掉让答案更优。 因此,我们只需要考虑最后一位是不是空格,如果是,讨论它在小 A 还是小 B。 具体而言,令 \(dp(i,j,…

    2022/8/23 6:23:53 人评论 次浏览
  • c++ lambda学习举例

    #include <iostream> #include<vector> #include<algorithm> #include<cmath> #include<ctime> using std::cout; using std::vector; using std::srand; using std::time; using std::generate; using std::endl; using std::count_if; us…

    2022/8/22 1:55:34 人评论 次浏览
  • 暑假集训七[One,砖块,数字,甜圈]

    暑假集训七 您总算更新当天的东西了啊。 题面 A.One 典型的约瑟夫问题,\(t<10,n \leq 1e7\)数据范围需要我们用线性算法。 考虑每次去掉一个人后都重新编号,把编号改为 \([0, n)\) 计算,最后剩下的那个数当前的编号一定为 \(0\)。 倒推,考虑一个个复活,草,所以可…

    2022/8/21 23:54:01 人评论 次浏览
  • [NOIP2001 提高组] 一元三次方程求解

    以0.01精度在[-100,100]枚举根。#include<iostream> #include<iomanip> int main() {double a,b,c,d;std::cin>>a>>b>>c>>d;for(double x=-100.0;x<=100.0;x+=0.01){double f=a*x*x*x+b*x*x+c*x+d;if(f>-0.01&&f<0.…

    2022/8/21 23:53:57 人评论 次浏览
  • C++ 时分秒的无限循环打印

    #include <iostream> #include <string> #include <windows.h> using namespace std; int main() {int count = 0;for (int i=0;i < 24; i++){for (int j = 0; i < 60; j++) {for (int k = 0; k < 60; k++) {count++;cout << i <<…

    2022/8/15 1:23:48 人评论 次浏览
  • C++ while/for循环的简单应用 1到100相加

    1.while循环:#include <iostream> using namespace std; int main() {int b = 1;int sum = 0 ;while (b<101){sum += b;b++;}cout << "总数为:" << sum << endl;system("pause");return 0; }2.for循环#include <ios…

    2022/8/15 1:23:47 人评论 次浏览
  • C++ timed_mutex

    #include <iostream> #include <thread> #include <mutex>std::timed_mutex mutex;void mythread() {std::chrono::milliseconds timeout(100); //100msstd::chrono::milliseconds sleep(100);while(true){//if(mutex.try_lock_for(timeout))if(mutex.t…

    2022/8/14 1:23:22 人评论 次浏览
  • 【Zig】Zig 中 Hash 的使用,如 Md5、Sha1

    Zig 中做Md5 和 Sha1 之类的Hash 非常简单的,现在支持Hash 算法有,blanke2、Blanke3、Gimli、Md5、Sha1、sha2、sha3,还有一个 组合 composition。 Md5 pub fn md5() void {const Md5 = std.crypto.hash.Md5;var out: [Md5.digest_length]u8 = undefined;const input =…

    2022/8/11 6:26:51 人评论 次浏览
  • std::move std::forward及使用

    概念std::move:无条件把参数转换为右值; std::forward:根据实参类型决定传递给下一层function的参数类型使用;被称为完美转发 (也叫精确传递); std::forward比较多的是配合 T&& 使用(使用在template代码中);其作用之一是将参数本层调用传递给下一层调用。…

    2022/8/11 6:24:34 人评论 次浏览
  • C++异步async

    #include <iostream> #include <future>int mythread() {std::cout << "mythread " << std::this_thread::get_id() << std::endl;std::chrono::milliseconds second(3000);std::this_thread::sleep_for(second);return 5; }int …

    2022/8/9 1:24:19 人评论 次浏览
扫一扫关注最新编程教程