Quantcast
Channel: Tips for golfing in C - Code Golf Stack Exchange
Viewing all articles
Browse latest Browse all 67

Answer by MegaTom for Tips for golfing in C

$
0
0

for(int i=0;i<n;i++){a(i);b(i);}can be made shorter a few ways:

for(int i=0;i<n;){a(i);b(i++);}-1 for moving the ++ to the last i in the loop

for(int i=0;i<n;b(i++))a(i);-3 more for moving all but one statement into the top and out of the main loop, removing the braces


Viewing all articles
Browse latest Browse all 67

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>