Code optimization (for a competition)

Bartek (7)
Hi, can we optimize more this code?

1
2
#include<stdio.h>
main(){int n,i;scanf("%i",&n);while(n--){scanf("%i",&i);printf("%d\n",(i+1)*i/2);}}


Thanks.
Peter87 (3687)
What kind of optimization are you after? It looks like you are trying to write the program in as few characters as possible but that will not affect the run-time performance.
Bartek (7)
Yes, I know. The code must be just as short as possible and,
evidently, works.
ResidentBiscuit (2209)
Write it in J
Registered users can post here. Sign in or register to post.