当前位置:网站首页>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 :
边栏推荐
- 【操作教程】TSINGSEE青犀视频平台如何将旧数据库导入到新数据库?
- The era of enterprise full cloud -- the future of cloud database
- 想转行学软件测试担心哪些问题?
- 4個不可不知的采用“安全左移”的理由
- Bluecmsv1.6- code audit
- How to calculate the fuzzy comprehensive evaluation index? How to calculate the four fuzzy operators?
- 五分钟快速搭建一个实时人脸口罩检测系统(OpenCV+PaddleHub 含源码)
- Scanpy(七)基于scanorama整合scRNA-seq实现空间数据分析
- 打新债安不安全 有风险吗
- Software engineering review questions
猜你喜欢

Super simple case: how to do hierarchical chi square test?

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

How to calculate the independence weight index?

以科技赋能设计之美,vivo携手知名美院打造“产学研”计划

What do various optimizers SGD, adagrad, Adam and lbfgs do?

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

What are the indicators of DEA?

leetcode. 13 --- Roman numeral to integer

Measure the current temperature

Software engineering review questions
随机推荐
故障:Outlook 收发邮件时的 0x800CCC1A 错误
Stm32cubemx learning (5) input capture experiment
Log in to MySQL 5.7 under ubuntu18 and set the root password
配置、软件配置项、软件配置管理项辨析
35岁腾讯员工被裁员感叹:北京一套房,存款700多万,失业好焦虑
Home server portal easy gate
《树莓派项目实战》第五节 使用Nokia 5110液晶屏显示Hello World
4 reasons for adopting "safe left shift"
EasyPlayer流媒体播放器播放HLS视频,起播速度慢的技术优化
Unity addressable batch management
Bluecmsv1.6- code audit
五分钟快速搭建一个实时人脸口罩检测系统(OpenCV+PaddleHub 含源码)
第五天 脚本与UI系统
Scanpy (VII) spatial data analysis based on scanorama integrated scrna seq
Stack awareness - stack overflow instance (ret2libc)
Almost taken away by this wave of handler interview cannons~
How to analyze the coupling coordination index?
What are the indicators of VIKOR compromise?
Go language learning tutorial (13)
Data-centric vs. Model-centric. The Answer is Clear!