Code optimization (for a competition)

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.
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.
Yes, I know. The code must be just as short as possible and,
evidently, works.
Write it in J
Topic archived. No new replies allowed.