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

就计算一个求和,一个乘法一个减法,竟TLE了,帮我看看!

Posted by ngn999 at 2008-07-23 18:51:17 on Problem 3117
#include <stdio.h>
int main(){
	int t, n, i;
	char name[21];
	long sum;
	int score;
    scanf("%d%d", &t,&n);
	while( t!=0 && n!= 0){
		sum = 3*n;
		for(i = 1; i <= n; i++){
			scanf("%s%d", name,&score);
			sum =sum - score;
		}
		printf("%d\n",sum);
		scanf("%d%d", &t,&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