学习_C语言小小计天工具

PPT高清导出秘籍:如何轻松设置600dpi图片分辨率 本文详细解析了PPT导出图片模糊的根本原因,并提供了通过修改Windows注册表将导出分辨率从默认的96dpi提升至600dpi的完整教程。该方法能显著提升图片清晰度,满足学术出版与高质量印刷需求,文中还包含效果对比、进阶设置及常见问题解答。 阅读详情

/*
 * 程序功能:计算出恋人相恋的天数
 * 程序设计思想:总天数 = 年差 + 月差 + 日差
 *
 *      年差:用for循环从起始年累计,逢闰年+一天
 *      月差:将月份与年份分离,先计算出该月与1月1日相差的天数,再在总天数上
 *      进行加减
 *      日差同理
 * 2014/05/29   codor   第一次修改
 *  新增功能:计算并显示出相恋第N天后的日期,加入选择界面    取名为code of love 1.0版
 * 2014/06/03   codor   第二次修改
 */

#include <stdio.h>
#include <stdlib.h>

int confirm(int,int,int);//判断日期输入是否正确
int change_month(int,int);//用于计算输入天数求得的月份
int count_month(int); //用于计算除去整数年后,剩余整数月的天数的函数
void what_day(int,int,int,int,int,int);//计算恋爱的天数
void love_day(int,int,int,int);//用于计算相恋第几天后的日期
int welcome();//欢迎界面
void bye();//退出界面
void stop_it();//控制刷屏
int leap_or_not(int year){  //用于判断是否是闰年的函数
    if(year % 400 == 0 || (year % 4 == 0 && year %100 != 0)){
            return 366;
    }
    else {
        return 365;
    }
}

char name1[20],name2[20];

int main(){

    int syear = 0, smonth = 0, sday = 0; //起始日期
    int lyear = 0, lmonth = 0, lday = 0; //结束日期 
    int getdate = 0;
    int boo = 0,option = 0;
    int s_iffirm = 1,l_iffirm = 1;


    welcome();
    printf("请输入您的选择:");
    scanf("%d",&boo);
    if(boo == 0){
            bye();
            return 0;
    }
 
    printf("请输入你的名字:");
    scanf("%s",name1);
    printf("请输入你伴侣的名字:");
    scanf("%s",name2);
    while(s_iffirm){
        printf("请输入相恋的年,月,日:\n");
        scanf("%d%d%d",&syear,&smonth,&sday);
        s_iffirm = confirm(syear,smonth,sday);
    }

    while(1){
        system("clear");
        printf("********************************************\n");
        printf("********************************************\n");
        printf("*********1、计算相恋的天数******************\n");
        printf("*********2、显示相恋N天后的日期*************\n");
        printf("*********0、退出程序************************\n");
        printf("********************************************\n");
        printf("********************************************\n");
        printf("请选择:");
        scanf("%d",&option);
        if(option == 1){
            while(l_iffirm){
                 printf("请输入今天的年,月,日:\n");
                 scanf("%d%d%d",&lyear,&lmonth,&lday);
                 l_iffirm = confirm(lyear,lmonth,lday);
                 if(lyear < syear){
                     printf("年份不能小于起始年份,请重新输入!\n");
                     l_iffirm = 1;
                 }
            }
            what_day(syear,smonth,sday,lyear,lmonth,lday);
            stop_it();
        }
        else if(option == 2) {
            printf("请输入你想要查看哪一天的日期:");
            scanf("%d",&getdate);
            love_day(syear,smonth,sday,getdate);
            stop_it();
        }
        else {
            bye();
            return 0;
        }
    }

}

int welcome(){
    system("clear");
    printf("********************************************\n");
    printf("********************************************\n");
    printf("********************************************\n");
    printf("********************************************\n");
    printf("********************************************\n");
    printf("**********欢迎使用计算日期功能!************\n");
    printf("********************************************\n");
    printf("**********继续请输入1,退出请输入0**********\n");
    printf("********************************************\n");
    printf("********************************************\n");
    printf("********************************************\n");
    printf("********************************************\n");
}
void bye(){
    system("clear");
    printf("\n********************************************\n");
    printf("********************************************\n");
    printf("**************Bye Bye !!********************\n");
    printf("********************************************\n");
    printf("********************************************\n");
}
void stop_it(){
    char stoping[4];
    printf("返回请输入任意数字:");
    scanf("%s",stoping);
}
int confirm(year,mth,day){
    if(year  < 1900 || year > 2050 ||
            mth < 1 || mth > 12 ||  
            day < 1 || day > 31){
        printf("输入错误,请重新输入\n");
        return 1;
    }
    if(mth == 2 || mth == 4 || mth == 6 || mth == 9 || mth == 11){
        if((mth == 2 && day > 29) || day > 30){
            printf("日期输入错误,小月不大于30,请重新输入\n");
            return 1;
        }
    }
    return 0;
}
int count_month(month){
    int sum1 = 0;
    switch(month){
        case  1:sum1 =  0;break;
        case  2:sum1 = 31;break;
        case  3:sum1 = 59;break;
        case  4:sum1 = 90;break;
        case  5:sum1 =120;break;
        case  6:sum1 =151;break;
        case  7:sum1 =181;break;
        case  8:sum1 =212;break;
        case  9:sum1 =243;break;
        case 10:sum1 =273;break;
        case 11:sum1 =304;break;
        case 12:sum1 =334;break;
        default:printf("输入错误,请核对!dd");break;
    }
    return sum1;
}

int change_month(year,month){
    switch(month){
        case  1:
        case  3:
        case  5:
        case  7:
        case  8:
        case 10:
        case 12:return 31;
        case  4:
        case  6:
        case  9:
        case 11:return 30;
        case  2:if(leap_or_not(year)%365){return 29;}
                    else {return 28;}
        default:printf("输入错误,请核对!cc");break;
    }
}

void what_day(syear,smonth,sday,lyear,lmonth,lday){
    int ssum = 0,lsum = 0;
    int ttl = 0;
    int i = 0;//用于循环,无实际意义
    ssum = count_month(smonth); //获得返回的天数
    lsum = count_month(lmonth);

    for(i = syear; i < lyear;i++){
        ttl += leap_or_not(i);
    }

    if(leap_or_not(syear) == 366 && smonth >2){
    //若为闰年,且日期在2月之后,则加1
        ssum++;
    }
    if(leap_or_not(lyear) == 366 && lmonth >2){
        lsum++;
    }
    ttl = ttl + lsum - ssum + lday - sday;
    printf("%s和%s相恋了%d天\n",name1,name2,ttl);
}

void love_day(year,month,day,getdate){
    int theday = getdate;
    while (getdate / leap_or_not(year)){
        getdate -= leap_or_not(year++);
    }
    while (getdate / (change_month(year,month))){
        getdate -= change_month(year,month++);
        if(month == 12){
            month = month % 12;
            year++;
        }
    }
    day = day + getdate;
    while (day / change_month(year,month)){
        day -= change_month(year,month++);
        if(month == 12){
            month = month % 12;
            year++;
        }
        printf("减去%d\n",day);
    }
    printf("你们相恋第%d天的日期是%d年%d月%d日\n",theday,year,month,day);
}

基于STM32的工业I/O模块硬件电路实现 深入解析基于STM32的工业I/O模块硬件电路实现,涵盖关键电路设计与信号处理,突出硬件电路稳定性和工业级可靠性,适合嵌入式开发者参考。 阅读详情

相关推荐

CloudCompare里那个CSF地面滤波插件,到底怎么用?手把手教你分离点云里的地面

本文详细介绍了如何在CloudCompare中使用CSF地面滤波插件分离点云中的地面数据。通过解析布料模拟滤波算法的核心参数,如布料刚度和网格分辨率,并提供不同地形(城市、丘陵、山地)的适配策略,帮助用户高效处理复杂点云数据。文章还包含实战案例和优化技巧,确保滤波结果的精度和可靠性。

weixin_42548708的博客 223

c语言小计

生命周期:全局 / 静态区、常量区、代码区随程序全程存在;栈区随函数生命周期;堆区由程序员控制;管理方式:栈 / 代码 / 常量 / 全局区由系统自动管理;堆区必须手动申请 / 释放,易出内存泄漏;读写性:仅代码区、常量区只读,其余区域可读可写;常见坑:修改常量区字符串、堆内存忘记 free、栈区定义超大数组导致溢出。理解这些内存区域,能帮你解决变量值异常、内存泄漏、栈溢出等常见问题,也是后续学习指针、动态内存管理的基础。

2403_89396487的博客 726

HyperMesh实战:5种复杂载荷场景下的field映射技巧(附TCL脚本)

本文详细介绍了HyperMesh在5种复杂载荷场景下的field映射技巧,包括轴承载荷的圆柱坐标系映射、粉末压力中的切向力处理、实验数据到有限元模型的场映射、多工况载荷的组合映射以及局部细化网格的边界条件传递。通过实战案例和TCL脚本,帮助工程师高效解决有限元分析中的载荷映射难题,提升工作效率。

fanta的博客 295

《C语言接口与实现》学习小计 1

《C语言接口与实现》学习小计

ydwr_cs的博客 303

app逆向分析案例-95分

先把justtrusmeplus打开设置好95分,开始抓包,得到结果为: https://www.95fenapp.com/api_goods/list/v3.0?is_all=1&keywords=%E7%A7%91%E6%AF%94& page=1&page_size=20 &publish_timestamp=0 &scene=2&scene_type=95fen_android_search_personal&sn=SearchList

weixin_41763171的博客 2747

Android HCE模拟NFC标签:实现跨设备NDEF数据共享

本文详细介绍了Android HCE技术如何模拟NFC标签实现跨设备NDEF数据共享。通过核心代码实现和标准AID配置,使手机能够被第三方NFC应用直接读取,支持文本、网址、Wi-Fi配置等多种数据类型,大幅提升设备间数据交换的便捷性和兼容性。

pytorch8learner的博客 252

c语言小知识点小计

c语言知识点小计

m0_69841436的博客 495

【机器人开发】四足机械狗(并联结构)URDF建模与Simscape仿真全流程解析

本文详细解析了四足机械狗(并联结构)从URDF建模到Simscape仿真的全流程开发。内容涵盖SolidWorks建模要点、URDF文件导出与优化、Matlab/Simscape环境搭建,以及并联机构特有的运动控制和步态规划实现,为机器人开发者提供了一套完整的解决方案。

weixin_30642561的博客 531

Fortran调用C语言小计

先简单记录下问题,以后再给续解决方案 1,关于fortran中module的使用 2,没有参数可以正常调用,当需要传递参数时,由于两者语言的差异,字符串结束符号不同,应该注意 3,关于调用C函数时,调用的两种方案,一是改Fortran语言增加C接口,第二是更改C语言使得Fortran能够识别 4,调用的本质理解,对编译连接有一定了解后就不用这么麻烦的模仿 5, 下面的命令编译两个源

vspiders的博客 2760

基于Simulink开发一个完整的直驱式永磁同步发电机DDPMSG仿真模型

需求分析直驱式永磁同步发电机(Direct-Drive Permanent Magnet Synchronous Generator, DDPMSG)广泛应用于风力发电、海洋能发电等可再生能源领域。与传统的齿轮箱驱动系统相比,DDPMSG具有结构简单、效率高、可靠性好等优点,能够直接将机械能转换为电能,减少了中间传动环节,降低了维护成本。本项目将基于Simulink平台,开发一个完整的DDPMSG仿真模型,模拟其在风力发电场景中的应用。我们将详细讲解如何设计和实现该系统,并结合实际应用案例进行说明。

MHD0815的博客 467

“华为杯”研究生数学建模竞赛2020年-【华为杯】B题:汽油辛烷值优化建模(附优秀论文)

摘 要:本文通过机器学习算法和数据挖掘技术,建立了汽油辛烷值(RON)损失的预测模型,在保证汽油产品脱硫效果的前提下,以降低汽油辛烷值损失在30%以上为目标,给出每个样本的优化操作条件。针对第一问,对285号和313号原始数据用给定的数据处理规范进行预处理,对每一列变量求期望,得到最终的数据补充到相应的样本编号。针对第二问,首先对数据样本按照最大最小限幅以及拉依达法则进行列变量清洗,通过两轮特征筛选确定变量:结合处理后的数据,针对产品中硫含量、RON损失值用。

getusushu的博客 1251

C语言指针小计

2、通过指针引用数组 3、指针和const 4、指针的类型转换 5、二位数组a的有关指针

words8的博客 1648

【嵌入式硬件】DRV8874电机驱动

1)N沟道H桥电机驱动;2)驱动1个双向有刷直流电机;3)2个单向有刷直流电机;4)4.5V-37V工作电压范围;5)集成电流感测和调节;6)成比例电流输出(IPROPI);7)可选电流调节(IMODE):逐周期或固定关断时间;8)支持1.8、3V、5V逻辑输入;9)集成保护:欠压、电荷泵欠压、过流保护、输出关闭、热关断、自动故障恢复。

qq_39200110的博客 4427

C语言小计

C 语言视频教程全集(180P)| 38 小时从入门到精通 一、传统数组的缺点 二、指针 1、指针简介 2、指针剖析 3、多级指针 三、结构体 1、结构体变量和结构体指针便来给你作函数参数传递的问题   - 推荐使用结构体指针变量作为函数参数来传递 2、结构体变量的运算 四、补码 1、基础 2、学习目标...

weixin_30241919的博客 115

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

深度学习工具包 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")

C标准库小计

现在C语言(C99)标准库函数的24个头文件列表如下: assert.h inttypes.h(C99) signal.h stdlib.h complex.h(C99) iso646.h(C95) stdarg.h string.h ctype.h limits.h stdbool.h tgmath.h(C99) errno.h locale.h stddef.h time.h f

锄禾日当午 1127

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

学习小计01

学习打卡

juzou41214的博客 178

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

c语言小计--基本数据类型及其表示

c语言的基本数据类型包括整型数据、实型数据和字符型数据。 【1】常量与变量 (1)常量 常量是指程序在运行时其值不能改变的量,它是c语言中使用的基本数据对象之一。常量分为数值常量及字符常量,其中数值常量分为整型常量和实型常量,字符常量分为字符常量和字符串常量。 这些类型决定了各种常量所占据空间的大小和数的表示范围。 (2)符号常量 在c语言中,常量除了以自身的存在形式直接表示以外,还可以用标识符来表示,即符号常量。 c语言使用宏定义命令对符号常量进行定义,其定义形式如下: ...

qq_64378985的博客 669

小计——C语言中的数组

一、一维数组1.创建和初始化int arr[3] = {0};2.使用数组是使用下标来访问的3.储存数组在内存中是连续存放的可以通过将数组的每一个元素地址打印出来,进行验证。4.数组的指针访问重要的,数组的数组名是数组首元素的地址而且,通过对数组名+整数的运算,其实可以获取到数组每个元素的地址二、二维数组1.创建和初始化int arr[3][4] = {0};定义时,数组的列数必须要自定义,行数可...

heihei233的博客 185

mysql 报表 小计 合计_MySQL_用SQL实现统计报表中的"小计"与"合计"的方法详解,客户提出需求,针对某一列分 - phpStudy...

用SQL实现统计报表中的"小计"与"合计"的方法详解客户提出需求,针对某一列分组加上小计,合计汇总。网上找了一些有关SQL加合计的语句。都不是很理想。决定自己动手写。思路有三个:1.很多用GROUPPING和ROLLUP来实现。 优点:实现代码简洁,要求对GROUPPING和ROLLUP很深的理解。缺点:低版本的Sql Server不支持。2.游标实现。 优点:思路逻辑简洁。缺点:复杂和低效。...

weixin_34862449的博客 339

C语言中的IO函数小计

1.gets(char *str)会把所有字符读入str,换行符'\n'会读取但不会保存,最终将被舍弃,gets函数可能会造成str溢出 2.puts(char*str)把str中所有字符打印,最终会自动追加一个换行符'\n' 3.scanf("%s",s);遇到空格,换行符会终止并跳过,但这些符号仍会存留在输入队列中,如: char bb[10]: if(scanf("%s",bb)==1

u011131874的专栏 603

C语言指针和内存分析小计

#include int a = 1; int d = 1; int *p1=&a; char *s0="wer"; char ** s00 = &s0; int main() {     int b=1;     int c=1;     int *p2 = &b;          char* s1 = "wer";     char* s2 = "wer";

HAPP NEW JAVA 417

C语言常见知识小计

知识点汇总 malloc和new的区别 主要从:申请内存所在位置、返回类型安全性、内存分配失败时的返回值、是否需要制定内存大小 这四个方面进行区分: 【1】申请的内存所在位置不同new操作符从自由存储区(free store)上为对象动态分配内存空间。自由存储区是C++基于new操作符的一个抽象概念,凡是通过new操作符进行内存申请,该内存即为自由存储区。malloc函数从堆上动态分配内存。堆是...

qq_38359370的博客 201

C语言,各种初始化方式及大小计

【代码】C语言,各种初始化方式及大小计。

qq_59510647的博客 285

object-c语法小计

大部分有一点其他平台开发基础的初学者看到XCode,第一感想是磨拳擦掌,看到Interface Builder之后,第一感想是跃跃欲试,而看到Objective-C的语法,第一感想就变成就望而却步了。好吧,我是在说我自己。      如果你和我一样,对苹果相关的开发:Mac OS X或是iPhone有兴趣,但是第一时间看到Objective-C就会头疼并伴有发烧症状的话,疗效比较好的快速治疗方法

iechenyb专栏 386

c语言编译defined,(五)c语言条件编译#ifdef与#if defined

c语言条件编译#ifdef与#if defineddefined NAME是用来判断NAME是否被定义了(被用define定义了)。#ifdef NAME == #if defined(NAME)#ifndef NAME == #if !defined(NAME)但是在处理双重和多重判断时,defined的优势就显示出来了#ifdef NAME1#ifdef NAME2......#endif#e...

weixin_42516021的博客 1942

C语言基础小计

typedef struct { uint16_t u16sn; //sn uint16_t tm_year :7; uint16_t tm_mon :4; uint16_t tm_day :5; uint16_t tm_hour :5; uint16_t tm_minute :6; uint16_t tm_second :5; uint16_t ReagentType; uint16_t u

MTPPZ的博客 931
上一篇: 学习_c语言中对字符串的操作
下一篇: 学习_意淫彩票生成代码
codeor
博客等级 码龄12年 0粉丝 5原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值