| 比赛 | 
    20130725暑期B班1测 | 
    评测结果 | 
    AAWWWWWWWWWWWW | 
    | 题目名称 | 
    残酷的数学老师 | 
    最终得分 | 
    14 | 
    | 用户昵称 | 
    日光。 | 
    运行时间 | 
    0.004 s  | 
    | 代码语言 | 
    C++ | 
    内存使用 | 
    0.37 MiB  | 
    | 提交时间 | 
    2012-07-18 10:45:12 | 
显示代码纯文本
#include<iostream>
#include<fstream>
using namespace std;
int ans[15001]={0};
int main()
{
	ifstream fin("cruel1.in");
	ofstream fout("cruel1.out");
	int m,n;
	fin>>n>>m;
	long long int temp=1;
	int i;
	for(i=1;i<=m;i++)
	{
		temp=temp*n;
	}
	i=1;
	while(temp)
	{
		ans[i]=temp%10;
		temp=(temp-ans[i])/10;
		i++;
	}
	for(int j=i-1;j>=1;j--)
	{
		fout<<ans[j];
		if(j%70==0) fout<<endl;
		else continue;
	}
	return 0;
}