Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:不怕不怕

Posted by Acmen19 at 2010-08-24 21:04:42 on Problem 1001
In Reply To:不怕不怕 Posted by:Acmen19 at 2010-08-24 21:03:44
> 只要你沉下心去只不过是一个大数的乘法并且还是最简单的  你只要数出来这个数小数点原来有几位  记下来 就行了 加油了 啊 输出的时候  找到要输出小数点的位置就行了 啊  嘿嘿 加油加油 Acmen19
> //这个只是用来做 一个整数的N次方 只是结果有点大罢了  剩下的就是数小数点  和输出地时候 找位置了 这些都很简单的  加油加油  瞎写的代码了 
> #include<stdio.h>
> int main()
> {
> 	int i,m,n,j;
> 	__int64 num[1000],t;
> 	while(scanf("%d%d",&n,&m)!=EOF){
> 		for(i=0;i<1000;i++)
> 			num[i]=0;
> 		num[1]=1;
> 		num[0]=1;
> 		for(i=1;i<=m;i++){
> 			for(t=0,j=1;j<=num[0];j++){
> 				num[j]*=n;
> 				num[j]+=t;
> 				t=num[j]/1000000000;
> 				num[j]%=1000000000;
> 			}
> 			if(t!=0){
> 				num[j]=t;
> 				num[0]++;
> 			}
> 		}
> 		for(i=num[0];i>0;i--){
> 			i==num[0]?printf("%I64d",num[i]):printf("%09I64d",num[i]);
> 		}
> 		putchar('\n');
> 	}
> 	return 0;
> }

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator