网站首页 站内搜索

搜索结果

查询Tags标签: cout,共有 1241条记录
  • P5717 【深基3.习8】三角形分类

    题目描述 给出三条线段 a,b,c 的长度,均是不大于 10000 的整数。打算把这三条线段拼成一个三角形,它可以是什么三角形呢? 输出要求: 如果三条线段不能组成一个三角形,输出Not triangle; 如果是直角三角形,输出Right triangle; 如果是锐角三角形,输出Acute triang…

    2021/10/21 23:42:00 人评论 次浏览
  • P3605 [USACO17JAN]Promotion Counting P

    Jennie 和常规的求逆序对差不多 在从根节点往下走的时候,我们必须要避免不在他子树内的点的影响 那就先减去他们呗。 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; …

    2021/10/21 23:39:23 人评论 次浏览
  • P3605 [USACO17JAN]Promotion Counting P

    Jennie 和常规的求逆序对差不多 在从根节点往下走的时候,我们必须要避免不在他子树内的点的影响 那就先减去他们呗。 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; …

    2021/10/21 23:39:23 人评论 次浏览
  • 2021-10-21-走台阶的C++问题,壮壮的程序和我的程序

    ==以下是壮壮的程序= #include <bits/stdc++.h> using namespace std; int v[1005]; int memo[1005]; int Max(int n){ if(memo[n] != 0){ return memo[n]; } if(n == 0) // return 0; if(n == 1) return v[0]; int max = Max(n-2); // if(max < Max(n-1)) max =…

    2021/10/21 14:09:48 人评论 次浏览
  • 2021-10-21-走台阶的C++问题,壮壮的程序和我的程序

    ==以下是壮壮的程序= #include <bits/stdc++.h> using namespace std; int v[1005]; int memo[1005]; int Max(int n){ if(memo[n] != 0){ return memo[n]; } if(n == 0) // return 0; if(n == 1) return v[0]; int max = Max(n-2); // if(max < Max(n-1)) max =…

    2021/10/21 14:09:48 人评论 次浏览
  • c++ day3 算术运算符 前置后置(递增递减) 与或非

    1,前置后置递增递减 a = 10 ++a //先让a加1,再进行表达式 a++ //先进行表达式,再让a加1 int a = 2;int b = a++;//a先赋值给b再自加1cout << b << endl;cout << a << endl;int c = ++a;//a先自加1再幅值给ccout << c << endl;2…

    2021/10/21 14:09:26 人评论 次浏览
  • c++ day3 算术运算符 前置后置(递增递减) 与或非

    1,前置后置递增递减 a = 10 ++a //先让a加1,再进行表达式 a++ //先进行表达式,再让a加1 int a = 2;int b = a++;//a先赋值给b再自加1cout << b << endl;cout << a << endl;int c = ++a;//a先自加1再幅值给ccout << c << endl;2…

    2021/10/21 14:09:26 人评论 次浏览
  • C++拷贝内存的方式给属性赋值

    #include <iostream> #include <string.h>using namespace std;struct TestStruct {int id;char *a{nullptr};char *b{nullptr};char *c{nullptr}; }; int main(int argc, const char *argv[]) {int size = sizeof(TestStruct) + 6 + 3 + 2;auto st = (TestSt…

    2021/10/21 7:11:38 人评论 次浏览
  • C++拷贝内存的方式给属性赋值

    #include <iostream> #include <string.h>using namespace std;struct TestStruct {int id;char *a{nullptr};char *b{nullptr};char *c{nullptr}; }; int main(int argc, const char *argv[]) {int size = sizeof(TestStruct) + 6 + 3 + 2;auto st = (TestSt…

    2021/10/21 7:11:38 人评论 次浏览
  • 实验一类与对象

    Complex.h#pragma once #ifndef CIRCLE_H #define CIRCLE_H class Complex { public:Complex();Complex(double a, double b);Complex(double a);Complex(Complex& c);double get_real() { return real; };double get_imag() { return imag; };double get_real() con…

    2021/10/21 6:11:06 人评论 次浏览
  • 实验一类与对象

    Complex.h#pragma once #ifndef CIRCLE_H #define CIRCLE_H class Complex { public:Complex();Complex(double a, double b);Complex(double a);Complex(Complex& c);double get_real() { return real; };double get_imag() { return imag; };double get_real() con…

    2021/10/21 6:11:06 人评论 次浏览
  • c++类构造函数&析构函数

    c++类构造函数&析构函数 使用初始化列表来初始化字段 Line::Line( double len): length(len) {cout << "Object is being created, length = " << len << endl; }上面的写法等价于 Line::Line( double len) {length = len;cout << …

    2021/10/21 1:09:34 人评论 次浏览
  • c++类构造函数&析构函数

    c++类构造函数&析构函数 使用初始化列表来初始化字段 Line::Line( double len): length(len) {cout << "Object is being created, length = " << len << endl; }上面的写法等价于 Line::Line( double len) {length = len;cout << …

    2021/10/21 1:09:34 人评论 次浏览
  • 实验一 类与对象

    task3: Complex.hpp源码:#ifndef Complex_hpp #define Complex_hpp#include <iostream> #include <cmath>using namespace std;class Complex { public:Complex(double a, double b = 0) : real { a }, imag { b }{}Complex(Complex const& ci) : real …

    2021/10/20 23:13:00 人评论 次浏览
  • 实验一 类与对象

    task3: Complex.hpp源码:#ifndef Complex_hpp #define Complex_hpp#include <iostream> #include <cmath>using namespace std;class Complex { public:Complex(double a, double b = 0) : real { a }, imag { b }{}Complex(Complex const& ci) : real …

    2021/10/20 23:13:00 人评论 次浏览
扫一扫关注最新编程教程