hdu 1042 N!
2015-07-27 17:25
323 查看
本题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1042
AC代码:
AC代码:
#include<stdio.h> #include<string.h> int str[110000]; int main() { int n,i,j,k,count,temp; while(scanf("%d",&n)!=EOF) { memset(str,0,sizeof(str)); count=1; str[0]=1; for(i=1;i<=n;i++) { k=0; for(j=0;j<count;j++) { temp=str[j]*i+k; str[j]=temp%10; k=temp/10; if(k!=0&&j==count-1) { count++; } } } for(i=j;;i--) if(str[i]!=0) break; for(;i>=0;i--) printf("%d",str[i]); printf("\n"); } return 0; }
相关文章推荐
- go语言常用函数:make
- shell awk
- setsockopt 用法详解
- BeanUtils.copyProperties(product, this);
- “System.NotSupportedException”类型的异常在 System.Data.Entity.dll 中发生,但未在用户代码中进行处理 其他信息: 在 LINQ to Entitie
- PHP 连接新浪云,mySQL数据库时,出错的问题解决
- 汉语是世界上唯一一种面向对象的高级语言
- Window平台OpenGL渲染环境之使用GLUT搭建
- EL表达式--EL输出时候属性名称该使用哪个
- ORACLE-014:oracle中查看DBLink密码
- Linux平台 Oracle 11gR2 RAC安装Part3:DB安装
- [转]解决vista和win7在windows服务中交互桌面权限问题:穿透Session 0 隔离
- MFC类基本层次结构
- A Knight's Journey(POJ_2488)
- 解决mysql"Access denied for user'root'@'IP地址'"问题
- 写于2014年4月的凄苦日子回忆录
- 123
- bzoj2553: [BeiJing2011]禁忌
- android 百度地图 定位功能
- poj 1017 Packets