斐波那契数列是一个经典的数学问题,在计算机编程中也经常用到。本文将使用C语言编写程序,通过循环计算斐波那契数列并输出结果。
#include <stdio.h>
int main() {
int n, i;
int fib[100]
墨衍会员
·
AI 创作全网分发
墨衍智能分发
本文由作者通过墨衍一键同步至各平台
1分发平台
100+累计阅读
91平均单平台
已同步平台
优快云
微信公众号
微博
知乎
掘金
百家号
博客园
抖音
小红书
你的文章也可以这样分发
墨衍会员 ¥399起/年,写一次发全网
我也要 →
码龄3年
斐波那契数列是一个经典的数学问题,在计算机编程中也经常用到。本文将使用C语言编写程序,通过循环计算斐波那契数列并输出结果。
#include <stdio.h>
int main() {
int n, i;
int fib[100]
C++信息学竞赛真题解析:从语法基础到算法思维启蒙
C++作为信息学竞赛的主流编程语言,其基础语法和计算思维是编程学习的核心。理解变量、运算符、分支与循环等基础概念,是掌握程序逻辑控制的第一步。在工程实践中,通过分析典型真题,可以深入理解这些概念如何应用于解决实际问题,例如通过取模和整除运算实现数位分离,或利用循环与条件判断完成数据筛选。真题的价值在于它精准映射了竞赛的考点与能力要求,不仅帮助学习者巩固C++语法,更重要的是训练将自然语言描述的问题转化为精确算法步骤的能力。对于小学生信息学启蒙而言,这种从具体问题中提炼通用解题模式的过程,正是计算思维培养的关
全国青少年信息素养大赛 C++算法创意实践挑战赛初赛 集训模拟试卷《一》及详细答案解析
信息素养大赛初赛C++模拟试卷一 选择题(共15题,每题5分,共75分) 1、人工智能产品的主要功能不包括以下哪项 A、自动识别图像 B、数据分析 C、自我意识 D、语言翻译 答案:C 考点分析:考察小朋友们对人工智能相关知识的了解,自动识别图像是属于计算机视觉领域,数据分析是属于机器学习范畴,语言翻译是属于自然语言处理,都是AI研究范畴,答案C 2、计算机的哪个组成部分负责执行程序指令 A、控制器 B、存储器 C、输入设备 D、输出设备 答案:A 考点分析:考察小朋友
全国青少年信息素养大赛 Python编程挑战赛初赛 内部集训模拟试卷六及详细答案解析
信息素养大赛初赛Python编程模拟试卷六 选择题 1、以下程序的运行结果是 def f(x,y.z):print(x,y,z) f(z=3,x=2.y=1) A、3 2 1 B、1 2 3 C、2 1 3 D、3 1 2 答案:C 考点分析:考察函数的调用,调用f函数的时候传入了指定的参数及对应的值,所以输出的时候会输出对应的值;如果没有指定实参名字就是按顺序一个一个匹配;答案C 2、关于以下程序,下列表述中错误的一项是 c=1 def fun(n): a=1 for
2021 年 6 月青少年软编等考 C 语言三级真题解析
2021 年 6 月青少年软编等考 C 语言三级真题解析。
2023年03月中国电子学会青少年软件编程(图形化)等级考试试卷(三级)答案 + 解析
2023年03月中国电子学会青少年软件编程(图形化)等级考试试卷(三级)答案 + 解析
Spark on Yarn 高可用模式部署流程
本文介绍了如何配置Spark和Yarn的高可用(HA)环境,以确保在大规模数据处理中避免单点故障。
生成式引擎优化(GEO)- 搜索引擎优化
生成式引擎优化(GEO)是针对AI内容生成平台(如ChatGPT)的新型优化策略,旨在提升品牌内容在AI生成答案中的引用率,与传统SEO存在显著差异。GEO通过优化内容权威性、结构化和语义关联,适应AI的RAG技术架构,采用3C原则(可爬性、网络共识、反馈校正)提升内容可见性。其核心区别在于目标(引用率vs排名)、技术(语义优化vs关键词)及算法透明度(封闭vs开放)。适用场景包括商业决策、行业权威建设及公共知识服务,帮助品牌在AI时代占据信息主导权。
FRM模型五:Brinson业绩归因
利用Brinson对基金组合业绩进行归因分析。
服务器安装Ubuntu 18.04.2 LTS超详细步骤(小白图文详解)
服务器安装Ubuntu 18.04.2 LTS超详细步骤(小白图文详解) 本文不包括启动盘制作步骤,相关内容可自行百度 华为服务器 1 插入u盘,关机重启 2 初始化界面后进入到系统的BIOS设置界面 (华为服务器按Del键,不同品牌方法不同) 3 进入的时候,华为的服务器默认设置了BIOS密码,因此需要输入之前预设的密码。 注意密码大小写问题,若密码输错三次,则需重启 4 密码输入以后,进入...
基于粒子群优化的PID控制在药液流量控制系统中的应用
本文提出了一种基于粒子群优化(PSO)的PID控制算法,用于药液流量控制系统。系统采用C37控制器和Codesys 2.3编程环境实现,通过传感器实时监测流量、压力和车速,并控制水泵占空比和电动球阀开度来精确调节药液流量。硬件配置包括FT-2000流量传感器、PT-3000压力传感器和MV-500电动球阀等。控制算法将PSO与PID结合,使用ITAE指标优化PID参数,在Codesys中实现了包含PSO优化循环、PID控制等功能的程序模块。该系统通过分层控制策略和智能优化算法,提高了药液流量控制的精度和响应
Prompt Engineering 学习指南:从入门到精通的最佳路径与资源
随着大型语言模型(LLM)能力的飞速发展,Prompt Engineering(提示工程)已成为人与AI协作的核心技能。本报告旨在为不同水平的学习者提供一条清晰、高效的学习路径,整合了当前社区公认的最佳实践和顶级开源资源,帮助您系统地掌握 Prompt Engineering,释放 LLM 的全部潜力。保持好奇心,不断尝试,您将能驾驭语言模型这一强大的工具,创造出前所未有的价值。超越简单的“一问一答”,学习如何将 Prompt Engineering 与外部工具和数据结合,构建强大的 AI 应用。
基金估值核算系统三国杀:恒生 VS 赢时胜 VS 融选!
本文对比分析了恒生电子、赢时胜和融选科技三家金融科技公司的基金估值系统。恒生电子作为行业龙头,在公募基金领域占据较大份额,其新一代估值系统6.0采用微服务架构,自动化程度高;赢时胜在中型公募和券商资管领域优势明显,其V5.5系统在信创适配和复杂产品处理方面表现突出;融选科技作为新兴厂商,提供轻量化解决方案,适合中小型机构。文章从市场格局、系统定位、技术架构、成本构成和用户反馈五个维度进行深入比较,为金融机构选型提供参考。当前估值系统市场呈现"三国鼎立"格局,各具特色,选型需结合机构规模、
蓝牙模块HM-10手册
蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
win10 跳过U8环境检测的IE WebControls.rar
win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。
android 蓝牙通讯demo
android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。
250

被折叠的 条评论
为什么被折叠?



