it looke like I am not the only one having trouble with this one. I have gotten my answer down to a single space, but hours poring over C references have not been fruitful beyond this.
created
last reply
- 23
replies
- 946
views
- 16
users
- 1
link
it looke like I am not the only one having trouble with this one. I have gotten my answer down to a single space, but hours poring over C references have not been fruitful beyond this.
the hardest part of this problem is testing. since mauke says both of my solutions are buggy im guessing something i used is part of GCC extensions but not C99, which means ive found 0 instead of 1 solution. if i had a "standard" compiler to throw ideas at id probably take another look at this one, but until then im not quite up to the task of re-reading the standards.
Huhu, I found the "obvious" other solution first; the /**/ thing was an afterthought. I'm pretty sure that whitespaceless C is turing-complete, even without preprocessor tricks like comments.
"Whitespace" is a sequence of 1 or more white characters. White characters recognized by the judge include: ' ' (space), '\t', (tab), '\n' (newline), '\r' (carriage return), '\f' (form feed) and '\v' (vertical tab). No other ASCII char is white, but there may be other white characters such as char 160 (non-breaking space); I haven't tested those.
A general comment: '\0' (NUL) isn't whitespace. It can't be used to separate tokens either. (I don't care if this works in gcc.)
Pardon the revival of this thread, but do we use
"char * const"
or
"const char *"
? The description is rather ambiguous about this, and I think I am being rejected because I may have the wrong one (it makes a huge difference to the token-parsing and stuff, and the amount of hackish things you need to make it work)
typedef/**/struct{unsigned/**/aku;char/**/*const/**/soku}zan;
typedef/**/struct{unsigned(aku);char*const(soku)}zan;
Can someone point out whats wrong with these declarations....I am going mad with this problem.... spoj.pl/status/HAJIME,saurabh8c/3