NONO函数

计算机二级c语言等级考试 #include #include void NONO(); long fun( char *s ) { int i,sum=0,len; len=strlen(s); for(i=0;i<len;i++) { sum=sum+*s-48; s++; } return sum; } 立即下载
NONO ( )
{/* 本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。 */
FILE *rf, *wf ;
int i, a,b ; long c ;

rf = fopen("in1.dat", "r") ;
wf = fopen("bc01.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(rf, "%d,%d", &a, &b) ;
fun(a, b, &c) ;
fprintf(wf, "a=%d,b=%d,c=%ld/n", a, b, c) ;
}
fclose(rf) ;
fclose(wf) ;
}

12S BMS 核心设计:基于 STM32H743+BQ34Z100 的 SOC/SOH 实现与全链路技术解析(上) 本文详细介绍了基于STM32H743和BQ34Z100的12串锂电池管理系统(BMS)设计。该系统采用主控制器+专用电量监测计架构,可实现高精度SOC(±1%)和SOH(±2%)估算,支持36V-50.4V电压范围。硬件设计包括电压/电流采样、温度测量、保护电路等模块,软件实现基于HAL库开发,采用DMA方式提高I2C通信效率。系统通过TI专利的ImpedanceTrack™算法实现三维融合估算,并具备完善的保护功能。该设计适用于电动工具、轻型电动车等中功率设备,具有精度高、响应快。 阅读详情

相关推荐

CLCD土地覆盖数据在ArcGIS中的实战应用:从导入到空间分析的完整指南

本文详细介绍了CLCD土地覆盖数据在ArcGIS中的实战应用,从数据导入到空间分析的完整流程。涵盖坐标系转换、数据质量检查、土地利用变化检测等核心技术,并分享城市扩张模拟和跨数据集融合等高级应用技巧,帮助研究者高效利用这一权威数据集进行环境监测和城市规划。

weixin_29292535的博客 591

(计算机二级C语言)程序设计题<22>

【代码】(计算机二级C语言)程序设计题<22>

2301_79580018的博客 560

MT6816角度传感器SPI通信避坑指南:从数据手册到稳定读取的3个关键步骤

本文详细解析了MT6816角度传感器SPI通信中的常见问题与解决方案,包括寄存器地址计算、SPI时序配置和数据校验等关键步骤。通过实测波形和代码示例,帮助工程师避开数据手册中的隐藏陷阱,实现稳定可靠的角度数据读取,特别适用于高精度电机控制场景。

weixin_42520573的博客 516

c语言norm函数的作用,C语言的高级操作(一)

文本屏幕的输入输出一、窗口定义用到的函数1、textmode(newmode)说明:设置屏幕文本显示方式newmode的取值方式符号常量显示的列*行数和颜色0BW4040*25黑白1C4040*25彩色2BW8080*25黑白3C8080*25彩色7MONO80*25单色-1LASEMODE上次的显示方式2、window(left,top,right,botoom)说明:用来定义屏幕上的一个矩形...

weixin_29258297的博客 1104

Linux下自动化解析q7签名文件的有效期与时间戳

本文详细介绍了在Linux环境下自动化解析q7签名文件有效期与时间戳的方法。通过编写高效脚本,开发者可以批量提取签名时间信息,验证签名有效性,并集成到CI/CD流程中。文章提供了完整的脚本实现,包括错误处理、批量处理功能,并解决了常见环境问题,特别适用于国产操作系统如UOS的开发场景。

weixin_30872499的博客 519

2.1 SRv6 TE Policy

SRv6 TE Policy是在SRv6技术基础上发展的一种新的隧道引流技术。SRv6 TE Policy路径表示为指定路径的段列表(Segment List),称为SID列表(Segment ID List)。每个SID列表是从源到目的地的端到端路径,并指示网络中的设备遵循指定的路径,而不是遵循IGP计算的最短路径。如果数据包被导入SRv6 TE Policy中,SID列表由头端添加到数据包上,网络的其余设备执行SID列表中嵌入的指令。

m0_70976024的博客 1237

(计算机二级C语言)程序设计题<109>

【代码】(计算机二级C语言)程序设计题<109>

2301_79580018的博客 483

SAP WM模块事务码(TCODE)大全

OL07 Data transfer stor.bins LDK34->RLPLA 仓储位LDK34 ->RLPLA

matinal 當冬夜漸暖 。公众号:matinal 5846

c语言上机编程题技巧,二级C语言上机编程题技巧总结.doc

二级C语言上机编程题技巧方法总结二级C语言上机编程题在二级上机考试中属于较难题型,因此很多同学都害怕通过不了。综合往年的考试,结合考试大纲,每年考试的编程题都有一定的规律和方法,只要同学们认真熟练使用做题的方法,通过考试是没有问题的。编程题做题方法一:使用C语言特有的函数做题编程思想:使用C语言函数库中的做题,做题时必须注意包含对应的头文件考题举例:题库中的第37题,要求将数字字符串转化为对应整数...

weixin_42217306的博客 690

双层优化入门(1)—基本原理与求解方法(附matlab代码)

双层优化问题(Bilevel Programming Problems),也被称为双层规划,最早由Stackelberg与1934年在经济学相关研究中提出,因此也被称为Stackelberg问题。双层规划问题一般具有层次性、独立性、冲突性、优先性和自主性等特点。 本文介绍了双层优化的原理与求解方法,并提供了相应的matlab代码供参考学习。

配电网和matlab的博客 5万+

改进爬山算法之六:随机重启爬山算法(Random-Restart Hill Climbing,RRHC)

随机重启爬山算法(Random-Restart Hill Climbing,RRHC)是爬山算法的一种改进策略,是一种启发式搜索算法,旨在通过随机重启来克服传统爬山算法容易陷入局部最优解的局限性,并增加找到全局最优解的概率。随机重启爬山算法通过在多次运行中不断尝试不同的初始解,并在每次运行中执行标准的爬山算法,最终选择所有运行中找到的最佳解作为最终结果。(1)计算复杂度:由于需要多次运行爬山算法,因此算法的计算复杂度可能较高,特别是在解空间较大或每次迭代需要较长时间的情况下。

搏博的专栏 2205

在C语言二级考试中编程题编译,二级C语言上机编程题

《二级C语言上机编程题》由会员分享,可在线阅读,更多相关《二级C语言上机编程题(34页珍藏版)》请在人人文库网上搜索。1、二级C语言上机编程题技巧一、 方法总结1、 二级C语言上机编程题在二级上机考试中属于较难题型,因此很多同学都害怕通过不了。综合往年的考试,结合考试大纲,每年考试的编程题都有一定的规律和方法,只要同学们认真熟练使用做题的方法,通过考试是没有问题的。2、 编程题做题方法一:使用C语...

weixin_31645409的博客 929

华为OD技术面八股文_C++_01

汇总华为OD技术面C++方向八股文真题,并提供详细解答。

qq_45776114的博客 1885

(计算机二级C语言)程序设计题<32>

【代码】(计算机二级C语言)程序设计题<32>

2301_79580018的博客 433

深度学习工具包 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');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

RxJavaExtensions高级特性:函数式编程与响应式流的无缝集成

RxJavaExtensions是RxJava 4.x的扩展库,提供了丰富的额外操作符、组件以及1.x版本辅助库的移植实现,帮助开发者更高效地进行函数式编程与响应式流处理。 ## 核心功能概览:超越基础的响应式编程体验 🚀 RxJavaExtensions作为RxJava的强力补充,主要包含三大类核心组件: - **自定义操作符与转换器**:如`FlowableTransformers`和

gitblog_00140的博客 388

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

c语言二级编程题04,请编一个函数fun,函数的功能是使实型数保留2位小数,并对第三位进行四舍五入(规定实型数为正数)。例如:实型数为1234.567,则函数返回1234.570000;

请编一个函数fun,函数的功能是使实型数保留2位小数,并对第三位进行四舍五入(规定实型数为正数)。例如:实型数为1234.567,则函数返回1234.570000;请勿改动主函数main和其它函数中的任何内容,仅在函数fun的花括号中填入你编写的若干语句。实型数为1234.564,则函数返回1234.560000。

weixin_65002380的博客 1393

(计算机二级C语言)程序设计题<108>

【代码】(计算机二级C语言)程序设计题<108>

2301_79580018的博客 499

(c语言)计算多项式

【代码】(c语言)计算多项式。

2301_79580018的博客 544

C 二级 s作为函数值返回。 在C语言中可调用log()函数求n(n)。log函数的引 用说明是: double log(double x)

#include <math.h> #include <stdio.h> double fun(int m) { double s=0.0; int i; for(i=1; i<=m; i++)s+=log(1.0*i); s=sqrt(s); return s; } main() { void NONO (); printf("%f\n", fun(20)); NONO(); } void NONO () {/* 本函数用于打开文件,输入数据,调用函数,..

Roninzhz的博客 1168

(计算机二级C语言)程序设计题<25>

【代码】(计算机二级C语言)程序设计题<25>

2301_79580018的博客 458

c语言二级编程题01, 请编写一个函数fun,它的功能是:将ss所指字符串中所有下标为奇数位置上的字母转换成大写(若该位置上不是字母,则不转换)。例如,若输入“abc4EFG“,则应输出“aBc4EF

请编写一个函数fun,它的功能是:将ss所指字符串中所有下标为奇数位置上的字母转换成大写(若该位置上不是字母,则不转换)。例如,若输入"abc4EFG",则应输出"aBc4EFG"。 请勿改动主函数main和其它函数中的任何内容,仅在函数fun的花括号中填入你编写的若干语句。

weixin_65002380的博客 996

(计算机二级C语言)程序设计题<61>

【代码】(计算机二级C语言)程序设计题<61>

2301_79580018的博客 482

C语言题目练习5C

该函数的功能是:求出二维数组周边元素之和,作为函数值返回。二维数组中的值在主函数中。在此程序中,编写函数fun,

qq_64262619的博客 153

删除字符串最后面的一连串相同的符号,以'*'为例

#include <stdio.h>void fun( char a, char h,char p ){int i=0; char q=a; while(q<h) {a[i]=q; q++;i++;} while(q<p) {if(q!='') {a[i]=q; i++;} q++;} while(q) {a[i]=q; i++; q++;} a[i]='\0';} vo...

weixin_33716941的博客 126

(计算机二级C语言)程序设计题<106>

【代码】(计算机二级C语言)程序设计题<106>

2301_79580018的博客 350

(计算机二级C语言)程序设计题<13>

【代码】(计算机二级C语言)程序设计题<13>

2301_79580018的博客 424

C语言二级编程题03,请编写一个函数fun,它的功能是:计算并输出给定整数n的所有因子(不包括1与n自身)之和。规定n的值不大于1000。例如,在主函数中从键盘给n输入的值为856,则输出为: sum

请编写一个函数fun,它的功能是:计算并输出给定整数n的所有因子(不包括1与n自身)之和。规定n的值不大于1000。例如,在主函数中从键盘给n输入的值为856,则输出为: sum=763。 请勿改动主函数main和其它函数中的任何内容,仅在函数fun的花括号中填入你编写的若干语句。

weixin_65002380的博客 1561
上一篇: 关于把C程序连接到核心的设置, --核心开发入门
下一篇: C语言之extern声明辨析
bmsdr
博客等级 码龄22年 11粉丝 65原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值