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

为什么是WA?没错啊!!帮我看看吧

Posted by cymxing at 2007-07-27 11:11:18 on Problem 1953
#include<stdio.h>
int a[100];
__int64 fun1(int t)
{__int64 r=1;
 int i;
 for(i=1;i<=t;i++)
    r*=2;
 return r;
}

__int64 fun2(int t)
{__int64 r=0;
 int i;
 for(i=0;i<t;i++)
	 r+=i;
 return r;
}
 
__int64 cymx(int t)
{
 __int64 r;
 r=fun1(t)-fun2(t);
 return r;
}

__int64 main()
{
 int m;
 int i;
 scanf("%d",&m);
 for(i=1;i<=m;i++)
 {  
	 scanf("%d",&a[i]);}
 for(i=1;i<=m;i++)
	 printf("\nScenario #%d:\n%I64d\n",i,cymx(a[i]));
           printf("\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