Sujet : Re: Suggested method for returning a string from a C program?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 19. Mar 2025, 09:53:34
Autres entêtes
Organisation : None to speak of
Message-ID : <875xk5v1td.fsf@nosuchdomain.example.com>
References : 1 2
User-Agent : Gnus/5.13 (Gnus v5.13)
Ike Naar <
ike@sdf.org> writes:
On 2025-03-19, DFS <nospam@dfs.com> wrote:
I'm doing these algorithm problems at
https://cses.fi/problemset/list/
>
For instance: Weird Algorithm
https://cses.fi/problemset/task/1068
[...]
What happens if the input is a negative number?
The problem statement says n is a positive integer.
I've been playing with some of these myself. I'm actually using
scanf() for integer input, something I wouldn't do in normal code
(because the behavior is undefined if the scanned value is out
of range). This is a rare case where it's safe to assume that
stdin has nothing harmful.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */