当前位置:网站首页>C language "recursive series": recursive implementation of 1+2+3++ n
C language "recursive series": recursive implementation of 1+2+3++ n
2022-06-25 08:29:00 【zbossz】
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include<string.h>
int fun(int m)
{
int w;
if (m==1)
w = 1;
else
w=fun(m - 1) + m;
return w;
}
int main()
{
int n;
scanf("%d", &n);
printf("1+2+...+%d=%d\n",n,fun(n));
return 0;
}

analysis :
边栏推荐
- Summary of NLP data enhancement methods
- How to analyze the grey prediction model?
- How to calculate the information entropy and utility value of entropy method?
- What problems do you worry about when you want to switch to software testing?
- UEFI:修复 EFI/GPT Bootloader
- QSS 不同风格的按钮
- Retrieval model rough hnsw
- After using the remote control of the working machine, problems occurred in the use of the local ROS, and the roscore did not respond
- SharePoint:SharePoint Server 2013 与 ADRMS 集成指南
- 初识生成对抗网络(11)——利用Pytorch搭建WGAN生成手写数字
猜你喜欢

What are the indicators of entropy weight TOPSIS method?

What about the exponential smoothing index?

How to calculate the correlation coefficient and correlation degree in grey correlation analysis?

EasyPlayer流媒体播放器播放HLS视频,起播速度慢的技术优化

How is the ISM model analyzed?

TCP acceleration notes

Stack awareness - stack overflow instance (ret2libc)

Log in to MySQL 5.7 under ubuntu18 and set the root password

GPU calculation

leetcode.13 --- 罗马数字转整数
随机推荐
STM32CubeMX 學習(5)輸入捕獲實驗
[QT] QT 5 procedure: print documents
Beam search and five optimization methods
Find out the possible memory leaks caused by the handler and the solutions
Is there any risk in making new bonds
CVPR 2022 oral 2D images become realistic 3D objects in seconds
家庭服务器门户Easy-Gate
Getting to know the generation confrontation network (11) -- using pytoch to build wgan to generate handwritten digits
Is there no risk in the security of new bonds
打新债的安全性 有风险吗
是否可以给数据库表授予删除列对象的权限?为什么?
Super simple case: how to do hierarchical chi square test?
What do various optimizers SGD, adagrad, Adam and lbfgs do?
TCP stuff
Getting to know the generation confrontation network (12) -- using pytoch to build wgan-gp to generate handwritten digits
在二叉树(搜索树)中找到两个节点的最近公共祖先(剑指offer)
Bluecmsv1.6-代码审计
Wechat applet introduction record
2022年毕业生求职找工作青睐哪个行业?
Biweekly investment and financial report: capital ambush Web3 infrastructure