沧桑不尽
无穷的沧桑,不尽的落叶
int _tmain(int argc, _TCHAR* argv[])
{
	char num1[100] = {'1'};
	char num2[100] = {'2'};
	char sum[101] = {0};
	for (int i=0;i<100;++i)
	{
		num1[i] = '1';
		num2[i] = '9';
	}
	int nJinWei = 0;
	int nTmpSum = 0;
	for (int i=0;i<100;++i)
	{
		nTmpSum = (num1[i] - '0') + (num2[i]-'0') + nJinWei;

		nJinWei = nTmpSum / 10;
		sum[i] = nTmpSum % 10;
	}
	sum[100] = nJinWei;
	for (int i=1;i<=101;i++)
	{
		printf("%d",sum[101-i]);
	}
	getchar();
	return 0;
}
posted on 2011-03-11 10:57  沧桑不尽  阅读(311)  评论(0编辑  收藏  举报