I saw a problem which asks you to print "Hello World" using the fewest characters, including spaces. How can I further shorten this code? Thank you in advance!
#include<iostream>
int main(){printf("Hello World");}
Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. It only takes a minute to sign up.
Sign up to join this community
#include <iostream>
and useputs
instead ofprintf
(assuming you're using a kind compiler that allows you to use these functions without including cstdio) (edit: it seems that neither G++ nor clang are kind enough and I was wrong) This question should almost certainly be tagged [tips]. \$\endgroup\$