当前位置:网站首页>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 :
边栏推荐
- Almost taken away by this wave of handler interview cannons~
- linux中的mysql有10061错误怎么解决
- 使用pytorch搭建MobileNetV2并基于迁移学习训练
- [QT] QT 5 procedure: print documents
- Exchange:管理日历权限
- Getting to know the generation confrontation network (11) -- using pytoch to build wgan to generate handwritten digits
- Websocket understanding and application scenarios
- Hyper-v:Hyper-v 第 1 代或第 2 代虚拟机
- 《树莓派项目实战》第五节 使用Nokia 5110液晶屏显示Hello World
- In 2022, which industry will graduates prefer when looking for jobs?
猜你喜欢

Bluecmsv1.6- code audit

使用pytorch搭建MobileNetV2并基于迁移学习训练

Incluxdb time series database

How to calculate the distance between texts: WMD

The era of enterprise full cloud -- the future of cloud database

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

Scanpy (VII) spatial data analysis based on scanorama integrated scrna seq

With the beauty of technology enabled design, vivo cooperates with well-known art institutes to create the "industry university research" plan

CVPR 2022 oral 2D images become realistic 3D objects in seconds

How to analyze the grey prediction model?
随机推荐
微信小程序_7,项目练习,本地生活
软件确认测试有什么作用?确认测试报告的价格是多少?
Log in to MySQL 5.7 under ubuntu18 and set the root password
Is there any risk in the security of new bonds
tp5与tp6的区别是啥呀?
What are the indicators of entropy weight TOPSIS method?
股票网上开户安全吗?小白求指导
How to calculate the independence weight index?
Overview of image super score: the past and present life of image super score in a single screen (with core code)
With the beauty of technology enabled design, vivo cooperates with well-known art institutes to create the "industry university research" plan
TCP acceleration notes
How do I install the software using the apt get command?
以科技赋能设计之美,vivo携手知名美院打造“产学研”计划
What is SKU and SPU? What is the difference between SKU and SPU
配置、软件配置项、软件配置管理项辨析
rosbag
Is there any risk in making new bonds
如何设计测试用例
First experience Amazon Neptune, a fully managed map database
Is it safe to open an account for stocks on the Internet? Can the securities account be used by others?