Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

Qualified's blog

By Qualified, history, 4 weeks ago, In English,

When I'm using:

#define rep(i, a, b) for(int i = a; i < b; i++)
#define per(i, a, b) for(int i = a; i >= b; i--)

how do I do

for(;;)

with the

rep(i, a, b)
per(i, a, b)
 
 
 
 
  • Vote: I like it
  • -20
  • Vote: I do not like it

»
4 weeks ago, # |
  Vote: I like it +53 Vote: I do not like it

Is simply writing for(;;) not shorter?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it
per(i,1,i) will work.