哪里的佛山网站建设/免费网站提交入口

哪里的佛山网站建设,免费网站提交入口,做什么网站开发好,推广营销策划科技特长生方向,主要学习的内容为 一,《C语法》 二,《数据结构》 三,《算法》 四,《计算机基础知识》 五,《初高中的数学知识》 其中,《C语法》学习的主要内容如下: 1,cout输出语句和键盘…

 

科技特长生方向,主要学习的内容为 

一,《C++语法》

二,《数据结构》

三,《算法》

四,《计算机基础知识》

五,《初高中的数学知识》

其中,《C++语法》学习的主要内容如下:

1,cout输出语句和键盘的基本操作

#include <iostream>
int main()
{std::cout << "dsaffd\n";
}

2,int整数变量的定义和加减运算

#include <iostream>
int main()
{int a;a = 10;int b = 20;int c;c = a + b;std::cout << "c=" << c << std::endl;
}

3,cin输入和if else 判断语句的使用

#include <iostream>
int main()
{int a, b;std::cin >> a >> b;if (a > b){std::cout << "a大" << std::endl;}else {std::cout << "b大" << std::endl;}
}

4,float变量的定义和使用

#include <iostream>
using namespace std;
int main()
{cout << "计算器程序 加法输入1 减法输入2"<<endl;int a;cin >> a;if (a == 1){float b, c, d;cout << "请输入第1个数 然后按回车" << endl;cin >> b;cout << "请输入第2个数 然后按回车" << endl;cin >> c;d = b + c;cout << "两个数的和是" << d << endl;}    else if (a == 2){float b, c, d;cout << "请输入第1个数 然后按回车" << endl;cin >> b;cout << "请输入第2个数 然后按回车" << endl;cin >> c;d = b - c;cout << "两个数的差是" << d << endl;}
}

5,int 一维数据的定义和使用

#include <iostream>
using namespace std;
int main()
{int x[3] = {5,3,2};cout << "数组中第1个数是" << x[0] << endl;cout << "数组中第2个数是" << x[1] << endl;cout << "数组中第3个数是" << x[2] << endl;cout << "第2和第3个数的和是" << x[1]+x[2] << endl;x[0] = 12;cout << "数组中第1个数 修改后是" << x[0] << endl;
}

6,++运算符的使用

#include <iostream>
using namespace std;
int main()
{int a=0;cout << a << endl;a++;cout << a << endl;a++;cout << a << endl;a++;cout << a << endl;a++;cout << a << endl;a++;cout << a << endl;a++;cout << a << endl;a++;cout << a << endl;a++;
}

7,for 循环语句的使用

#include <iostream>
using namespace std;
int main()
{for (int a=0;a<=100;a++){cout << a << endl;}
}

8,while循环语句的使用

#include <iostream>
using namespace std;
int main()
{int a = 0;while (a<=100){cout << a << endl;a++;}
}

9,无返回值 函数的定义和使用

#include <iostream>
using namespace std;
void 输出()
{cout << "fdsafs" << endl;
}
void 循环输出()
{for (int a = 0; a <= 100; a++){cout << a << endl;}
}
int main()
{输出();循环输出();
}

10,返回值 函数的定义和使用

#include <iostream>
using namespace std;
void 输出()
{cout << "fdsafs" << endl;
}
int 加法(int a, int b)
{int x;x = a + b;return x;
}
int 减法(int a, int b)
{int x;x = a - b;return x;
}
int main()
{输出();int x;x = 加法(2, 3);cout << "x=" << x << endl;
}

11,C++ 类

#include <iostream>
class A
{int a;//默认是私有数据,类外部无法调用 
private: //私有的 数据int b;
protected://protected 是介于 private 和 public 之间的一种可见性修饰符。protected 成员既不能被外部对象直接访问,但可以被派生类(继承类)访问int c;
public:  //公共的 数据int d;void ax(){a = 1008;std::cout << "ax函数:" << std::endl;}
};
int main()
{A m;m.d = 10;std::cout << m.d << std::endl;m.ax();
}

12,C++语法之类的继承一

#include <iostream>
class A
{
public:A(){a = 10;b = 20;}int a, b; void ax(){std::cout << "ax函数:"<< std::endl;}
};
class B :public A
{
public:void bx(){std::cout << "bx函数:" << std::endl;}
};int main()
{A m;m.ax();B n;n.ax();n.bx();
}

13,C++类的构造函数和析构函数

#include <iostream>
class A
{
public:int a;A(){a = 0;std::cout << "A的 不带参数的 构造函数:" << std::endl;}A(int b){a = b;std::cout << "A的 带参数的 构造函数:" << std::endl;}~A(){std::cout << "A的 析构函数:" << std::endl;}void ax(){std::cout << "ax函数:" << std::endl;}};
int main()
{std::cout << "测试一\n\n\n";A m;m.ax();std::cout << "\n\n测试二\n\n";A n(2);n.ax();
}

14,C++语法之类的继承中的构造函数

#include <iostream>
class A
{
public:A(){std::cout << "A的 构造函数:" << std::endl;}~A(){std::cout << "A的 析构函数:" << std::endl;}void ax(){std::cout << "ax函数:" << std::endl;}};
class B :public A
{
public:B(){std::cout << "B的 构造函数:" << std::endl;}~B(){std::cout << "B的 析构函数:" << std::endl;}
};int main()
{B m;m.ax();
}

15,指针的定义和使用

#include <iostream>
using namespace std;
int main()
{int a = 10;int* p;p = &a;cout << "a=" << a << endl;cout << "&a=" << &a << endl;cout << "p=" << p << endl;cout << "*p=" << *p << endl;*p = 20;cout << "a=" << a << endl;cout << "&a=" << &a << endl;cout << "p=" << p << endl;cout << "*p=" << *p << endl;}

16,C++语法之类的this指针

#include <iostream>
class A
{
public:A(){a = 10;b = 20;}int a, b; void add(int a, int b){int c= a + b;std::cout << "add:"<<c << std::endl;}void add2(int a, int b){int c = this->a + this->b;std::cout << "add2:" << c << std::endl;}void add3(int a, int b){       std::cout << "add3:" << std::endl;this->add(a,b);this->add2(a,b);}
};int main()
{A m;m.add(2, 3);m.add2(2, 3);m.add3(2, 3);
}

17,C++语法之命名空间一

#include <iostream>
namespace a
{void 输出(){std::cout << "命名空间a里的输出函数" << std::endl;}
};
namespace b
{void 输出(){std::cout << "命名空间b里的输出函数" << std::endl;}
};
using namespace a;//这里引入命名空间
int main()
{输出();
}
#include <iostream>
namespace a
{void 输出(){std::cout << "命名空间a里的输出函数" << std::endl;}
};
namespace b
{void 输出(){std::cout << "命名空间b里的输出函数" << std::endl;}
};int main()
{a::输出();//用命名空间调用函数
}

18,C++语法之命名空间二

A.h头文件中代码:

namespace a
{void 输出();
};


A.cpp源文件中代码:

#include <iostream>
#include "A.h"
void a::输出()
{std::cout << "A.h里的输出函数" << std::endl;
}


B.h头文件中代码:

namespace b
{void 输出();
};


B.cpp源文件中代码:

#include <iostream>
#include "B.h"
void b::输出()
{std::cout << "B.h里的输出函数" << std::endl;
}


主函数所在源文件代码1:引入命名空间 b

#include <iostream>
#include "A.h"
#include "B.h"
using namespace b;
int main()
{输出();
}


运行结果 : B.h里的输出函数

19,char变量和char数组和字符串

#include <iostream>
using namespace std;
int main()
{char a = 'x';cout << "a的值为" << a << endl;char x[3] = { 'a','b','c' };cout << "x[0]=" << x[0] << endl;cout << "x[1]=" << x[1] << endl;cout << "x[2]=" << x[2] << endl;char y[3] = { 'a','b','\0' };cout << "y[0]=" << y[0] << endl;cout << "y[1]=" << y[1] << endl;cout << "y[2]=" << y[2] << endl;cout << "y的值为" << y << endl;cout << "x的值为" << x << endl;
}

20,字符串相关函数

#include <iostream>
#include <cstring>using namespace std;int main ()
{char str1[13] = "runoob";char str2[13] = "google";char str3[13];int  len ;// 复制 str1 到 str3strcpy( str3, str1);cout << "strcpy( str3, str1) : " << str3 << endl;// 连接 str1 和 str2strcat( str1, str2);cout << "strcat( str1, str2): " << str1 << endl;// 连接后,str1 的总长度len = strlen(str1);cout << "strlen(str1) : " << len << endl;return 0;
}

21,结构体struct

#include <iostream>
#include <cstring>using namespace std;// 声明一个结构体类型 Books 
struct Books
{char  title[50];char  author[50];char  subject[100];int   book_id;
};int main( )
{Books Book1;        // 定义结构体类型 Books 的变量 Book1Books Book2;        // 定义结构体类型 Books 的变量 Book2// Book1 详述strcpy( Book1.title, "C++ 教程");strcpy( Book1.author, "Runoob"); strcpy( Book1.subject, "编程语言");Book1.book_id = 12345;// Book2 详述strcpy( Book2.title, "CSS 教程");strcpy( Book2.author, "Runoob");strcpy( Book2.subject, "前端技术");Book2.book_id = 12346;// 输出 Book1 信息cout << "第一本书标题 : " << Book1.title <<endl;cout << "第一本书作者 : " << Book1.author <<endl;cout << "第一本书类目 : " << Book1.subject <<endl;cout << "第一本书 ID : " << Book1.book_id <<endl;// 输出 Book2 信息cout << "第二本书标题 : " << Book2.title <<endl;cout << "第二本书作者 : " << Book2.author <<endl;cout << "第二本书类目 : " << Book2.subject <<endl;cout << "第二本书 ID : " << Book2.book_id <<endl;return 0;
}

22,C++ 数据类型

#include<iostream>  
#include <limits>using namespace std;  int main()  
{  cout << "type: \t\t" << "************size**************"<< endl;  cout << "bool: \t\t" << "所占字节数:" << sizeof(bool);  cout << "\t最大值:" << (numeric_limits<bool>::max)();  cout << "\t\t最小值:" << (numeric_limits<bool>::min)() << endl;  cout << "char: \t\t" << "所占字节数:" << sizeof(char);  cout << "\t最大值:" << (numeric_limits<char>::max)();  cout << "\t\t最小值:" << (numeric_limits<char>::min)() << endl;  cout << "signed char: \t" << "所占字节数:" << sizeof(signed char);  cout << "\t最大值:" << (numeric_limits<signed char>::max)();  cout << "\t\t最小值:" << (numeric_limits<signed char>::min)() << endl;  cout << "unsigned char: \t" << "所占字节数:" << sizeof(unsigned char);  cout << "\t最大值:" << (numeric_limits<unsigned char>::max)();  cout << "\t\t最小值:" << (numeric_limits<unsigned char>::min)() << endl;  cout << "wchar_t: \t" << "所占字节数:" << sizeof(wchar_t);  cout << "\t最大值:" << (numeric_limits<wchar_t>::max)();  cout << "\t\t最小值:" << (numeric_limits<wchar_t>::min)() << endl;  cout << "short: \t\t" << "所占字节数:" << sizeof(short);  cout << "\t最大值:" << (numeric_limits<short>::max)();  cout << "\t\t最小值:" << (numeric_limits<short>::min)() << endl;  cout << "int: \t\t" << "所占字节数:" << sizeof(int);  cout << "\t最大值:" << (numeric_limits<int>::max)();  cout << "\t最小值:" << (numeric_limits<int>::min)() << endl;  cout << "unsigned: \t" << "所占字节数:" << sizeof(unsigned);  cout << "\t最大值:" << (numeric_limits<unsigned>::max)();  cout << "\t最小值:" << (numeric_limits<unsigned>::min)() << endl;  cout << "long: \t\t" << "所占字节数:" << sizeof(long);  cout << "\t最大值:" << (numeric_limits<long>::max)();  cout << "\t最小值:" << (numeric_limits<long>::min)() << endl;  cout << "unsigned long: \t" << "所占字节数:" << sizeof(unsigned long);  cout << "\t最大值:" << (numeric_limits<unsigned long>::max)();  cout << "\t最小值:" << (numeric_limits<unsigned long>::min)() << endl;  cout << "double: \t" << "所占字节数:" << sizeof(double);  cout << "\t最大值:" << (numeric_limits<double>::max)();  cout << "\t最小值:" << (numeric_limits<double>::min)() << endl;  cout << "long double: \t" << "所占字节数:" << sizeof(long double);  cout << "\t最大值:" << (numeric_limits<long double>::max)();  cout << "\t最小值:" << (numeric_limits<long double>::min)() << endl;  cout << "float: \t\t" << "所占字节数:" << sizeof(float);  cout << "\t最大值:" << (numeric_limits<float>::max)();  cout << "\t最小值:" << (numeric_limits<float>::min)() << endl;  cout << "size_t: \t" << "所占字节数:" << sizeof(size_t);  cout << "\t最大值:" << (numeric_limits<size_t>::max)();  cout << "\t最小值:" << (numeric_limits<size_t>::min)() << endl;  cout << "string: \t" << "所占字节数:" << sizeof(string) << endl;  // << "\t最大值:" << (numeric_limits<string>::max)() << "\t最小值:" << (numeric_limits<string>::min)() << endl;  cout << "type: \t\t" << "************size**************"<< endl;  return 0;  
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/75550.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

3、孪生网络/连体网络(Siamese Network)

目的: 用Siamese Network (孪生网络) 解决Few-shot learning (小样本学习)。 Siamese Network并不是Meta Learning最好的方法, 但是通过学习Siamese Network,非常有助于理解其他Meta Learning算法。 这里介绍了两种方法:Siamese Network (孪生网络)、Trplet Loss Siam…

消息队列(Kafka及RocketMQ等对比联系)

目录 消息队列 一、为什么使用消息队列&#xff1f;消息队列有什么优点/缺点&#xff1f;介绍下Kafka、ActiveMQ、RabbitMQ、RocketMQ有什么优点缺点&#xff0c;如何取舍&#xff1f; 1.公司业务场景是什么&#xff0c;这个业务场景有什么挑战&#xff0c;如果不用MQ有什么麻…

解锁DeepSeek潜能:Docker+Ollama打造本地大模型部署新范式

&#x1f407;明明跟你说过&#xff1a;个人主页 &#x1f3c5;个人专栏&#xff1a;《深度探秘&#xff1a;AI界的007》 &#x1f3c5; &#x1f516;行路有良友&#xff0c;便是天堂&#x1f516; 目录 一、引言 1、什么是Docker 2、什么是Ollama 二、准备工作 1、操…

根据模板将 Excel 明细数据生成 PDF 文档 | PDF实现邮件合并功能

在日常办公中&#xff0c;我们常常会面临这样的需求&#xff1a;依据特定的模板&#xff0c;把 Excel 里的每一条数据转化为单独的 PDF 文档&#xff0c;且这些 PDF 文档中的部分内容会根据 Excel 数据动态变化。这一功能不仅能高效完成任务&#xff0c;还支持图片的动态替换&a…

如何设计一个订单号生成服务?应该考虑那些问题?

如何设计一个订单号生成服务&#xff1f;应该考虑那些问题&#xff1f; description: 在高并发的电商系统中&#xff0c;生成全局唯一的订单编号是关键。本文探讨了几种常见的订单编号生成方法&#xff0c;包括UUID、数据库自增、雪花算法和基于Redis的分布式组件&#xff0c;并…

Springboot 集成 Flowable 6.8.0

1. 创建 Spring Boot 项目 通过 Spring Initializr&#xff08;https://start.spring.io/ &#xff09;创建一个基础的 Spring Boot 项目&#xff0c;添加以下依赖&#xff1a; Spring WebSpring Data JPAMySQL DriverLombok&#xff08;可选&#xff0c;用于简化代码&#x…

《TCP/IP网络编程》学习笔记 | Chapter 22:重叠 I/O 模型

《TCP/IP网络编程》学习笔记 | Chapter 22&#xff1a;重叠 I/O 模型 《TCP/IP网络编程》学习笔记 | Chapter 22&#xff1a;重叠 I/O 模型理解重叠 I/O 模型重叠 I/O本章讨论的重叠 I/O 的重点不在于 I/O 创建重叠 I/O 套接字执行重叠 I/O 的 WSASend 函数进行重叠 I/O 的 WSA…

搭建Redis哨兵集群

停掉现有的redis集群 因为这篇文章我是在 搭建完redis主从集群之后写的&#xff0c;如果要是没有搭建过这些&#xff0c;可以直接略过。要是从我上一篇 搭建redis主从集群过来的&#xff0c;可以执行下。 docker compose down 查找下redis相关进程 ps -ef | grep redis 可以看…

《Python实战进阶》第33集:PyTorch 入门-动态计算图的优势

第33集&#xff1a;PyTorch 入门-动态计算图的优势 摘要 PyTorch 是一个灵活且强大的深度学习框架&#xff0c;其核心特性是动态计算图机制。本集将带您探索 PyTorch 的张量操作、自动求导系统以及动态计算图的特点与优势&#xff0c;并通过实战案例演示如何使用 PyTorch 实现…

23种设计模式-创建型模式-单例

文章目录 简介问题1. 确保一个类只有一个实例2. 为该实例提供全局访问点 解决方案示例重构前&#xff1a;重构后&#xff1a; 拓展volatile 在单例模式中的双重作用 总结 简介 单例是一种创建型设计模式&#xff0c;它可以确保一个类只有一个实例&#xff0c;同时为该实例提供…

python裁剪nc文件数据

问题描述&#xff1a; 若干个nc文件储存全球的1850-2014年月尺度的mrro数据(或其他数据)&#xff0c;从1850-1到2014-12一共1980个月&#xff0c;要提取出最后35年1980.1~2014.12年也就是420个月的数据。 代码实现 def aaa(input_file,output_file,bianliang,start_index,en…

数据清洗:基于python抽取jsonl文件数据字段

基于python抽取目录下所有“jsonl”格式文件。遍历文件内某个字段进行抽取并合并。 import os import json import time from tqdm import tqdm # 需要先安装&#xff1a;pip install tqdmdef process_files():# 设置目录路径dir_path r"D:\daku\关键词识别\1623-00000…

C# .net ai Agent AI视觉应用 写代码 改作业 识别屏幕 标注等

C# net deepseek RAG AI开发 全流程 介绍_c# 向量处理 deepseek-CSDN博客 视觉多模态大模型 通义千问2.5-VL-72B AI大模型能看懂图 看懂了后能干啥呢 如看懂图 让Agent 写代码 &#xff0c;改作业&#xff0c;识别屏幕 标注等等。。。 据说是目前最好的免费图片识别框架 通…

大模型应用开发之大模型工作流程

一&#xff1a;大模型的问答工作流程 1.1: 分词和向量化 如上图所示&#xff0c;我们如果让大模型去回答问题&#xff0c;首先我们会输入一些文字给到大模型&#xff0c;大模型本质上是个数学模型&#xff0c;它是理解不了人类的整句话的&#xff0c;所以它会把我们的对应的句…

12届蓝桥杯—货物摆放

货物摆放 题目描述 小蓝有一个超大的仓库&#xff0c;可以摆放很多货物。 现在&#xff0c;小蓝有 nn 箱货物要摆放在仓库&#xff0c;每箱货物都是规则的正方体。小蓝规定了长、宽、高三个互相垂直的方向&#xff0c;每箱货物的边都必须严格平行于长、宽、高。 小蓝希望所…

批量优化与压缩 PPT,减少 PPT 文件的大小

我们经常能够看到有些 PPT 文档明明没有多少内容&#xff0c;但是却占用了很大的空间&#xff0c;存储和传输非常的不方便&#xff0c;这时候通常是因为我们插入了一些图片/字体等资源文件&#xff0c;这些都可能会导致我们的 PPT 文档变得非常的庞大&#xff0c;今天就给大家介…

导游职业资格考试:从迷茫到清晰的备考指南

当你决定报考导游职业资格考试时&#xff0c;可能会感到有些迷茫&#xff0c;不知道从何处入手。别担心&#xff0c;这份备考指南将带你从迷茫走向清晰。​ 第一步&#xff0c;全面了解考试。导游职业资格考试分为笔试和面试。笔试的四个科目各有特点&#xff0c;《政策与法律…

【BFS】《BFS 攻克 FloodFill:填平图形世界的技术密码》

文章目录 前言例题一、 图像渲染二、 岛屿数量三、岛屿的最大面积四、被围绕的区域 结语 前言 什么是BFS&#xff1f; BFS&#xff08;Breadth - First Search&#xff09;算法&#xff0c;即广度优先搜索算法&#xff0c;是一种用于图或树结构的遍历算法。以下是其详细介绍&am…

Linux安装MySQL数据库并使用C语言进行数据库开发

目录 一、前言 二、安装VMware运行Ubuntu 1.安装VMware 2.使用VMware打开Ubuntu 三、配置VMware使用网卡 1.添加NAT网卡 四、Linux下安装MySQL数据库 五、安装MySQL开发库 六、演示代码 sql_connect.c sql_connect.h main.c中数据库相关代码 结尾 一、前言 由于最…

常见中间件漏洞之一 ----【Tomcat】

中间件Tomcat介绍&#xff1a; tomcat是⼀个开源⽽且免费的jsp服务器&#xff0c;默认端⼝ : 8080&#xff0c;属于轻量级应⽤服务器。它可以实现 JavaWeb程序的装载&#xff0c;是配置JSP&#xff08;Java Server Page&#xff09;和JAVA系统必备的⼀款环境。 在历史上也披露…