当前位置:网站首页>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 :
边栏推荐
- Remove headers from some pages in a word document
- 打新债安全不 有风险吗
- 【操作教程】TSINGSEE青犀视频平台如何将旧数据库导入到新数据库?
- How to calculate the positive and negative ideal solution and the positive and negative ideal distance in TOPSIS method?
- The difference between personal domain name and enterprise domain name
- [QT] QT 5 procedure: print documents
- [QT] qtcreator shortcut key and QML introduction
- Free SSL certificate acquisition tutorial
- Data preprocessing: discrete feature coding method
- VOCALOID notes
猜你喜欢

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

How to calculate the information entropy and utility value of entropy method?

NIPS 2014 | Two-Stream Convolutional Networks for Action Recognition in Videos 阅读笔记

What are the indicators of entropy weight TOPSIS method?

InfluxDB时序数据库

微信小程序_7,项目练习,本地生活

Bluecmsv1.6-代码审计

Bluecmsv1.6- code audit

Software engineering review questions

Rank sum ratio (RSR) index calculation
随机推荐
【操作教程】TSINGSEE青犀视频平台如何将旧数据库导入到新数据库?
Rosparam statement
面试前准备好这些,Offer拿到手软,将军不打无准备的仗
EasyPlayer流媒体播放器播放HLS视频,起播速度慢的技术优化
Paper:Generating Hierarchical Explanations on Text Classification via Feature Interaction Detection
五分钟快速搭建一个实时人脸口罩检测系统(OpenCV+PaddleHub 含源码)
Almost taken away by this wave of handler interview cannons~
How to calculate the independence weight index?
在哪个平台买股票开户安全?求分享
Free SSL certificate acquisition tutorial
What problems do you worry about when you want to switch to software testing?
leetcode.13 --- 罗马数字转整数
第五天 脚本与UI系统
What is SKU and SPU? What is the difference between SKU and SPU
Hyper-v:Hyper-v 第 1 代或第 2 代虚拟机
What is the role of software validation testing? What is the price of the confirmation test report?
Is there any risk in the security of new bonds
打新债安全不 有风险吗
Summary of NLP data enhancement methods
以科技赋能设计之美,vivo携手知名美院打造“产学研”计划