c 语言练习__求到N的阶乘的和。
2024-10-06 20:28:25
#include <stdio.h> /* 题目如下
* S = 1 + 2! + 3! + ... + N!
*/
int main(int argc, char *argv[])
{
int s = ;
int n = ;
int i = ;
int m = ; printf("Please input N :");
if (scanf("%d",&n) == ){
while (i <= n ){
m *= i++;
s += m;
}
printf("The result is %d \n", s); }
else
printf("Input Error.\n"); return ;
}
最新文章
- jgGrid中的editrules使用函数来进行验证
- Python mysql 操作小类,供大家用用
- 控制反转容器&; 依赖注入模式 ---读感。
- 使用Hue上传hive数据
- CSS之边框覆盖
- 【转】Hbase shell 常用命令
- xiaocms 关于搜索功能 添加搜索字段
- 部分视图调用方法总结(Action 、 RenderAction 、 Partial 、 RenderPartial)
- 迭代 Iterate
- Java 泛型具体解释
- 对redux的理解
- JavaScript练习2
- .net 4种单例模式
- 前端笔记之服务器&;Ajax(下)数据请求&;解决跨域&;三级联动&;session&;堆栈
- DSAPI多功能组件编程应用-文件类
- angular2的ElementRef在组件中获取不到
- 利用百度API(js),怎样通过地址获取经纬度
- python 大数据处理小结
- underscore.js源码研究(8)
- OSX10.12搭建IPv6本地环境测试APP
热门文章
- Python流程控制
- [ios]scrollView实现移动与缩放
- 微软职位内部推荐-Senior SDE for Win Shell Exp
- .net如何调试dll
- Careercup - Facebook面试题 - 6139456847347712
- java集合类(六)About Queue
- 中国餐馆过程(CRP)
- Matlab中sort函数的使用
- C#动态多线程实例
- Unity GameObject.activeSelf, GameObject.activeInHierarchy,GameObject.SetActive和SetActiveRecursively