| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:菜鸟求救,请大牛指点迷津。In Reply To:菜鸟求救,请大牛指点迷津。 Posted by:change at 2005-09-20 23:34:17 在你的电脑上开不了那么大的内存
但是测试的时候可以分配给你那么大的内存
尽管开大一点就可以拉
只要保证思路对就行
> #include"stdio.h"
> #define M 100000 //再开大10倍就不行了,所以达不到要求。我不知道有什么解法,请大牛们不吝赐教!
> int main()
> {
> int i,n,d1,d2,c,a[];
> scanf("%d",&n);
> for(i=n;i>=1;i--)
> {
> scanf("%d%d",&d1,&d2);
> c=d1+d2;
> if(c>=10)
> {
> a[i]=c%10;
> a[i+1]++;
> }
> else a[i]=c;
>
> }
>
> for(i=n;i>=1;i--)
> printf("%d",a[i]);
> printf("\n");
>
> return 0;
> }
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator