We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Because if there would be no space then it would read as 1 variable, f.e. you want to input 1 2 and 7. If you wont use space you'll get 127 as one number (int a = 127). Another solution to this problem would be seperating numbers with new line (pressing enter for each number individualy), but well, with spaces it is easier to show "starting values for tests"
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Input and Output
You are viewing a single comment's thread. Return to all comments →
Because if there would be no space then it would read as 1 variable, f.e. you want to input 1 2 and 7. If you wont use space you'll get 127 as one number (int a = 127). Another solution to this problem would be seperating numbers with new line (pressing enter for each number individualy), but well, with spaces it is easier to show "starting values for tests"