Timeline for Sum of primes between given range
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 17, 2020 at 9:04 | history | edited | Community Bot |
Commonmark migration
|
|
| S Oct 5, 2017 at 4:34 | history | suggested | numbermaniac | CC BY-SA 3.0 |
use # header
|
| Oct 5, 2017 at 3:55 | review | Suggested edits | |||
| S Oct 5, 2017 at 4:34 | |||||
| Jun 19, 2011 at 9:54 | comment | added | Joey |
You can save a character by using string[]ain the Main signature. Antother two by omitting the call to Math.Max and instead using int i=int.Parse(a[0]);i=2<i?i:2;. The latter can even be pulled into the for header to save another char for the ;.
|
|
| Jun 19, 2011 at 9:46 | comment | added | Joey | @jcolebrand, that's only true of fields, local variables have to be initialized. | |
| Jan 29, 2011 at 21:28 | comment | added | Nick Larsen |
...because it is never assigned before it is used (via s -= i; because thats just syntactic sugar for s = s - i; which tries to access s before setting it)
|
|
| Jan 29, 2011 at 21:21 | comment | added | Nick Larsen | Gives error when compiled without it | |
| Jan 29, 2011 at 6:20 | comment | added | jcolebrand | You know the compiler defaults numerics to 0 right? That'ld save you a couple more chars in there | |
| Jan 28, 2011 at 18:20 | comment | added | Nick Larsen | True, but efficiency wasn't in the rules! | |
| Jan 28, 2011 at 17:24 | comment | added | Nellius | I like how short this is, but I wonder how inefficient it would be when calculating up to 10^8! | |
| Jan 28, 2011 at 15:52 | history | answered | Nick Larsen | CC BY-SA 2.5 |