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 |
就计算一个求和,一个乘法一个减法,竟TLE了,帮我看看!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator