Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #105706 > unrolled thread

Program to find consecutive integers

Started byinsane_goat <nobody@nothing.net>
First post2017-03-10 04:21 +0000
Last post2017-04-16 21:18 -0700
Articles 20 on this page of 31 — 17 participants

Back to article view | Back to comp.lang.c


Contents

  Program to find consecutive integers insane_goat <nobody@nothing.net> - 2017-03-10 04:21 +0000
    Re: Program to find consecutive integers Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2017-03-09 22:26 -0700
      Re: Program to find consecutive integers insane_goat <nobody@nothing.net> - 2017-03-10 06:48 +0000
        Re: Program to find consecutive integers Ike Naar <ike@iceland.freeshell.org> - 2017-03-10 08:18 +0000
          Re: Program to find consecutive integers insane_goat <nobody@nothing.net> - 2017-03-10 08:48 +0000
            Re: Program to find consecutive integers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-10 10:38 +0000
              Re: Program to find consecutive integers insane_goat <nobody@nothing.net> - 2017-03-12 13:15 +0000
                Re: Program to find consecutive integers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-12 13:29 +0000
              Re: Program to find consecutive integers raltbos@xs4all.nl (Richard Bos) - 2017-03-14 07:49 +0000
            Re: Program to find consecutive integers Öö Tiib <ootiib@hot.ee> - 2017-03-10 05:12 -0800
          Re: Program to find consecutive integers jameskuyper@verizon.net - 2017-03-10 07:16 -0800
            Re: Program to find consecutive integers Ike Naar <ike@iceland.freeshell.org> - 2017-03-10 19:20 +0000
              Re: Program to find consecutive integers James Kuyper <jameskuyper@verizon.net> - 2017-03-10 15:21 -0500
                Re: Program to find consecutive integers Ike Naar <ike@iceland.freeshell.org> - 2017-03-10 20:36 +0000
                Re: Program to find consecutive integers insane_goat <nobody@nothing.net> - 2017-03-12 13:19 +0000
                  Gotta keep up with the times (Was: Program to find consecutive integers) gazelle@shell.xmission.com (Kenny McCormack) - 2017-03-12 13:25 +0000
                    Re: Gotta keep up with the times (Was: Program to find consecutive integers) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-03-12 08:11 -0700
                      Re: Gotta keep up with the times (Was: Program to find consecutive integers) gazelle@shell.xmission.com (Kenny McCormack) - 2017-03-12 15:53 +0000
                        Re: Gotta keep up with the times (Was: Program to find consecutive integers) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-03-12 10:50 -0700
                          Re: Gotta keep up with the times (Was: Program to find consecutive integers) gazelle@shell.xmission.com (Kenny McCormack) - 2017-03-12 18:25 +0000
                            Re: Gotta keep up with the times (Was: Program to find consecutive integers) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-03-12 16:20 -0700
                    Re: Gotta keep up with the times gordonb.g2pqz@burditt.org (Gordon Burditt) - 2017-03-14 01:09 -0500
                      Re: Gotta keep up with the times raltbos@xs4all.nl (Richard Bos) - 2017-03-14 07:43 +0000
                  Re: Program to find consecutive integers "James R. Kuyper" <jameskuyper@verizon.net> - 2017-03-12 10:28 -0400
              Re: Program to find consecutive integers Gareth Owen <gwowen@gmail.com> - 2017-03-11 07:42 +0000
        Re: Program to find consecutive integers jt@toerring.de (Jens Thoms Toerring) - 2017-03-10 10:21 +0000
          Re: Program to find consecutive integers Nathan Wagner <nw@hydaspes.if.org> - 2017-03-10 22:07 +0000
            Re: Program to find consecutive integers Nathan Wagner <nw@hydaspes.if.org> - 2017-03-10 22:20 +0000
            Re: Program to find consecutive integers jr <creature.eternal@gmail.com> - 2017-03-10 23:49 -0800
          Re: Program to find consecutive integers jt@toerring.de (Jens Thoms Toerring) - 2017-03-11 23:38 +0000
            Re: Program to find consecutive integers Tim Rentsch <txr@alumni.caltech.edu> - 2017-04-16 21:18 -0700

Page 1 of 2  [1] 2  Next page →


#105706 — Program to find consecutive integers

Frominsane_goat <nobody@nothing.net>
Date2017-03-10 04:21 +0000
SubjectProgram to find consecutive integers
Message-ID<o9t9jl$bkg$1@gioia.aioe.org>
I wrote this small program to find consecutive integers up to the target. I
am quite sure that there are some ways to speed it up, can anyone suggest
improvements?

-- begin --

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*
 * Find consecutive integers which add up to target
 */

int main(int argc, char *argv[])
{
	if (argc < 2) {
		fprintf(stderr, "usage: %s <target>\n", argv[0]);
		return EXIT_FAILURE;
	}

	const unsigned target = (unsigned) atoi(argv[1]);
	const unsigned max = target / 2;
	const unsigned max_consecs = max;
	unsigned answer;
	unsigned *nums;

	if ((nums = calloc(max_consecs, sizeof(int))) == NULL) {
		perror("calloc");
		return EXIT_FAILURE;
	}

	for (unsigned begin = 1; begin < max; ++begin) {
		for (unsigned consecs = 2; consecs < max_consecs; ++consecs) {
			answer = 0;
			memset(nums, 0, max_consecs * sizeof(int));

			for (unsigned i = 0; i < consecs; ++i) {
				nums[i] = i + begin;

				if ((answer += nums[i]) > target) {
					break;
				}
			}

			if (answer == target) {
				for (unsigned i = 0; nums[i] != 0; ++i) {
					if (i != 0) {
						putchar(' ');
					}

					printf("%d", nums[i]);
				}

				putchar('\n');
				free(nums);
				return EXIT_SUCCESS;
			} else if (answer > target) {
				break;
			}
		}
	}

	puts("no answer");

	free(nums);
	return EXIT_FAILURE;
}

-- end --

-- 
insane_goat

[toc] | [next] | [standalone]


#105707

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2017-03-09 22:26 -0700
Message-ID<1bpohpg0sy.fsf@pfeifferfamily.net>
In reply to#105706
Umm.... you're going to have to give a more complete description of the
problem statement before I, at any rate, will want to think about your
program.  To me, producing consecutive integers boils down to

for (i = start; i <= end; i++)
    printf("%\n", i);
    

[toc] | [prev] | [next] | [standalone]


#105708

Frominsane_goat <nobody@nothing.net>
Date2017-03-10 06:48 +0000
Message-ID<o9ti7j$lnp$1@gioia.aioe.org>
In reply to#105707
On 2017-03-10, Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
> Umm.... you're going to have to give a more complete description of the
> problem statement before I, at any rate, will want to think about your
> program.

Sorry. I was in a bit of a rush.

I meant consecutive integers which add up to the target.

> To me, producing consecutive integers boils down to
>
> for (i = start; i <= end; i++)
>     printf("%\n", i);
>     


-- 
Daniel Roskams

[toc] | [prev] | [next] | [standalone]


#105713

FromIke Naar <ike@iceland.freeshell.org>
Date2017-03-10 08:18 +0000
Message-ID<slrn3vfsoc4oes.lda.ike@iceland.freeshell.org>
In reply to#105708
On 2017-03-10, insane_goat <nobody@nothing.net> wrote:
> On 2017-03-10, Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
>> Umm.... you're going to have to give a more complete description of the
>> problem statement before I, at any rate, will want to think about your
>> program.
>>
>> To me, producing consecutive integers boils down to
>>
>> for (i = start; i <= end; i++)
>>     printf("%\n", i);
>     
> Sorry. I was in a bit of a rush.
>
> I meant consecutive integers which add up to the target.

The following sets of consecutive integers add up to the target 15:
{1,2,3,4,5}
{4,5,6}
{7,8}
{15}

Your algorithm produces the set {1,2,3,4,5},
Joe's algorithm produces the set {15}.

Why is your solution better than Joe's ?

[toc] | [prev] | [next] | [standalone]


#105716

Frominsane_goat <nobody@nothing.net>
Date2017-03-10 08:48 +0000
Message-ID<o9tp9d$10e0$1@gioia.aioe.org>
In reply to#105713
On 2017-03-10, Ike Naar <ike@iceland.freeshell.org> wrote:
> On 2017-03-10, insane_goat <nobody@nothing.net> wrote:
>> On 2017-03-10, Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
>>> Umm.... you're going to have to give a more complete description of the
>>> problem statement before I, at any rate, will want to think about your
>>> program.
>>>
>>> To me, producing consecutive integers boils down to
>>>
>>> for (i = start; i <= end; i++)
>>>     printf("%\n", i);
>>     
>> Sorry. I was in a bit of a rush.
>>
>> I meant consecutive integers which add up to the target.
>
> The following sets of consecutive integers add up to the target 15:
> {1,2,3,4,5}
> {4,5,6}
> {7,8}
> {15}
>
> Your algorithm produces the set {1,2,3,4,5},
> Joe's algorithm produces the set {15}.
>
> Why is your solution better than Joe's ?

Because it can find consecutive integers adding up to e.g. 296, which cannot
be produced by starting from 1.


-- 
Daniel Roskams

[toc] | [prev] | [next] | [standalone]


#105720

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2017-03-10 10:38 +0000
Message-ID<87zigtxvpw.fsf@bsb.me.uk>
In reply to#105716
insane_goat <nobody@nothing.net> writes:

> On 2017-03-10, Ike Naar <ike@iceland.freeshell.org> wrote:
>> On 2017-03-10, insane_goat <nobody@nothing.net> wrote:
>>> On 2017-03-10, Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
>>>> Umm.... you're going to have to give a more complete description of the
>>>> problem statement before I, at any rate, will want to think about your
>>>> program.
>>>>
>>>> To me, producing consecutive integers boils down to
>>>>
>>>> for (i = start; i <= end; i++)
>>>>     printf("%\n", i);
>>>     
>>> Sorry. I was in a bit of a rush.
>>>
>>> I meant consecutive integers which add up to the target.
>>
>> The following sets of consecutive integers add up to the target 15:
>> {1,2,3,4,5}
>> {4,5,6}
>> {7,8}
>> {15}
>>
>> Your algorithm produces the set {1,2,3,4,5},
>> Joe's algorithm produces the set {15}.
>>
>> Why is your solution better than Joe's ?
>
> Because it can find consecutive integers adding up to e.g. 296, which cannot
> be produced by starting from 1.

296 is the sum of the sequence (296).  The full statement of your
problem will either include some restrictions (for example the sequence
must be longer than 1 or the largest number in it must be less than some
limit) or some criterion for the best solution (the longest, the
shortest, etc) or maybe the requirement to produce (or count) all the
solutions.  You are probably working from some external problem
statement.  Can you link to it?

One thing to note is that your code allocated storage and did a lot of
adding things up (sorry, I did not study it) but you'll find a little
bit of mathematics goes a long way in this case.

Yours is not really a C question, but a C-related question is why are
you using C?  (Not a trick question, I'm genuinely interested.)

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#105857

Frominsane_goat <nobody@nothing.net>
Date2017-03-12 13:15 +0000
Message-ID<oa3hl4$mge$1@gioia.aioe.org>
In reply to#105720
On 2017-03-10, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
> insane_goat <nobody@nothing.net> writes:
>
>> On 2017-03-10, Ike Naar <ike@iceland.freeshell.org> wrote:
>>> On 2017-03-10, insane_goat <nobody@nothing.net> wrote:
>>>> On 2017-03-10, Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
>>>>> Umm.... you're going to have to give a more complete description of the
>>>>> problem statement before I, at any rate, will want to think about your
>>>>> program.
>>>>>
>>>>> To me, producing consecutive integers boils down to
>>>>>
>>>>> for (i = start; i <= end; i++)
>>>>>     printf("%\n", i);
>>>>     
>>>> Sorry. I was in a bit of a rush.
>>>>
>>>> I meant consecutive integers which add up to the target.
>>>
>>> The following sets of consecutive integers add up to the target 15:
>>> {1,2,3,4,5}
>>> {4,5,6}
>>> {7,8}
>>> {15}
>>>
>>> Your algorithm produces the set {1,2,3,4,5},
>>> Joe's algorithm produces the set {15}.
>>>
>>> Why is your solution better than Joe's ?
>>
>> Because it can find consecutive integers adding up to e.g. 296, which cannot
>> be produced by starting from 1.
>
> 296 is the sum of the sequence (296).  The full statement of your
> problem will either include some restrictions (for example the sequence
> must be longer than 1

Yes, it was this requirement.

> or the largest number in it must be less than some
> limit) or some criterion for the best solution (the longest, the
> shortest, etc) or maybe the requirement to produce (or count) all the
> solutions.  You are probably working from some external problem
> statement.  Can you link to it?

It was in a math test somewhere. I don't remember the exact wording but it was
something like "find the only set of more than 1 consecutive integers which
add up to 296".
>
> One thing to note is that your code allocated storage and did a lot of
> adding things up (sorry, I did not study it) but you'll find a little
> bit of mathematics goes a long way in this case.
>
> Yours is not really a C question, but a C-related question is why are
> you using C?  (Not a trick question, I'm genuinely interested.)

I decided it was an interesting 20-minute thing to do when I was bored. That's
all.


-- 
Daniel Roskams

[toc] | [prev] | [next] | [standalone]


#105860

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2017-03-12 13:29 +0000
Message-ID<87d1dmwrme.fsf@bsb.me.uk>
In reply to#105857
insane_goat <nobody@nothing.net> writes:

> On 2017-03-10, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
>> insane_goat <nobody@nothing.net> writes:
>>
>>> On 2017-03-10, Ike Naar <ike@iceland.freeshell.org> wrote:
>>>> On 2017-03-10, insane_goat <nobody@nothing.net> wrote:
>>>>> On 2017-03-10, Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
>>>>>> Umm.... you're going to have to give a more complete description of the
>>>>>> problem statement before I, at any rate, will want to think about your
>>>>>> program.
>>>>>>
>>>>>> To me, producing consecutive integers boils down to
>>>>>>
>>>>>> for (i = start; i <= end; i++)
>>>>>>     printf("%\n", i);
>>>>>     
>>>>> Sorry. I was in a bit of a rush.
>>>>>
>>>>> I meant consecutive integers which add up to the target.
>>>>
>>>> The following sets of consecutive integers add up to the target 15:
>>>> {1,2,3,4,5}
>>>> {4,5,6}
>>>> {7,8}
>>>> {15}
>>>>
>>>> Your algorithm produces the set {1,2,3,4,5},
>>>> Joe's algorithm produces the set {15}.
>>>>
>>>> Why is your solution better than Joe's ?
>>>
>>> Because it can find consecutive integers adding up to e.g. 296, which cannot
>>> be produced by starting from 1.
>>
>> 296 is the sum of the sequence (296).  The full statement of your
>> problem will either include some restrictions (for example the sequence
>> must be longer than 1
>
> Yes, it was this requirement.

... and positive integers only.

<snip>
>> Yours is not really a C question, but a C-related question is why are
>> you using C?  (Not a trick question, I'm genuinely interested.)
>
> I decided it was an interesting 20-minute thing to do when I was bored. That's
> all.

That makes sense.  I tend to use a language with a REPL for this sort of
"playing about" code because you can experiment more freely.  (That and
you usually get large integers built-in, not that that's likely to be
significant in this case.)

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#105995

Fromraltbos@xs4all.nl (Richard Bos)
Date2017-03-14 07:49 +0000
Message-ID<58c79f9d.460578@news.xs4all.nl>
In reply to#105720
Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:

> Yours is not really a C question, but a C-related question is why are
> you using C?  (Not a trick question, I'm genuinely interested.)

This is, in fact, a problem which is very much solvable in your head,
and IMO a very elegant one for doing so as well, if you think a bit
about the divisibility of N subsequent positive integers.

(Hint: nal A fhofrdhrag vagrtref ner qvivfvoyr ol A, jvgu jung
erznvaqre? Gurer ner gjb nafjref sbe gjb boivbhf frgf bs vagrtref.)

Of course, if you want to do it in C, not to solve the problem, but to
learn C, that's a valid option, too. But even then there are more
elegant and less elegant solutions.

Richard

[toc] | [prev] | [next] | [standalone]


#105721

FromÖö Tiib <ootiib@hot.ee>
Date2017-03-10 05:12 -0800
Message-ID<e4928258-d5f3-48f6-8de7-849a21e38f2f@googlegroups.com>
In reply to#105716
On Friday, 10 March 2017 10:48:54 UTC+2, insane_goat  wrote:
> On 2017-03-10, Ike Naar <ike@iceland.freeshell.org> wrote:
> > On 2017-03-10, insane_goat <nobody@nothing.net> wrote:
> >> On 2017-03-10, Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
> >>> Umm.... you're going to have to give a more complete description of the
> >>> problem statement before I, at any rate, will want to think about your
> >>> program.
> >>>
> >>> To me, producing consecutive integers boils down to
> >>>
> >>> for (i = start; i <= end; i++)
> >>>     printf("%\n", i);
> >>     
> >> Sorry. I was in a bit of a rush.
> >>
> >> I meant consecutive integers which add up to the target.
> >
> > The following sets of consecutive integers add up to the target 15:
> > {1,2,3,4,5}
> > {4,5,6}
> > {7,8}
> > {15}
> >
> > Your algorithm produces the set {1,2,3,4,5},
> > Joe's algorithm produces the set {15}.
> >
> > Why is your solution better than Joe's ?
> 
> Because it can find consecutive integers adding up to e.g. 296, which cannot
> be produced by starting from 1.

That is all true but so what? Joe's answer did not seemingly start
from 0 but from "start". Your requirements do not specify where that 
start is. It can't be 1 always but so what? Let me write little example
program based on Joe's answer (and mine choice of "start" and "end"): 

    #include <stdlib.h> 
    #include <stdio.h> 

    void consecutive( int target )
    {
        int start, end, sum, i;
        if ( target == 0 )
        {
            start = -42;
            end = 42;
        }
        else if ( target < 0 )
        {
            start = target;
            end = - 1 - target;
        }
        else
        {
            start = 1 - target;
            end = target;
        }
        
        sum = start;
        printf("%d", start);
        for (i = start + 1; i <= end; i++)
        {
            printf(" + %d", i);
            sum += i;
        }
        printf(" = %d\n", sum);
    }

    int main() 
    {
        consecutive( -7 ); 
        consecutive( -1 ); 
        consecutive( 0 ); 
        consecutive( 1 );
        consecutive( 7 ); 
        consecutive( 296 ); 
        return EXIT_SUCCESS; 
    }

It works far better than yours; no dynamic memory 
management or any other such nuisances and answer is
always correct too. So why we should even eyeball
your solution? 

[toc] | [prev] | [next] | [standalone]


#105723

Fromjameskuyper@verizon.net
Date2017-03-10 07:16 -0800
Message-ID<11e8e73e-fc33-48e7-92a7-6064330813cd@googlegroups.com>
In reply to#105713
On Friday, March 10, 2017 at 3:21:24 AM UTC-5, Ike Naar wrote:
> On 2017-03-10, insane_goat <nobody@nothing.net> wrote:
> > On 2017-03-10, Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
> >> Umm.... you're going to have to give a more complete description of the
> >> problem statement before I, at any rate, will want to think about your
> >> program.
> >>
> >> To me, producing consecutive integers boils down to
> >>
> >> for (i = start; i <= end; i++)
> >>     printf("%\n", i);
> >     
> > Sorry. I was in a bit of a rush.
> >
> > I meant consecutive integers which add up to the target.
> 
> The following sets of consecutive integers add up to the target 15:
> {1,2,3,4,5}
> {4,5,6}
> {7,8}
> {15}
> 
> Your algorithm produces the set {1,2,3,4,5},
> Joe's algorithm produces the set {15}.

Other possibilities include:
{-14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}

I suspect that this is not what insane_goat meant, but until he specifies the problem to be solved more precisely, this seems to qualify.

[toc] | [prev] | [next] | [standalone]


#105738

FromIke Naar <ike@iceland.freeshell.org>
Date2017-03-10 19:20 +0000
Message-ID<slrn3vfsoc5v88.fq0.ike@iceland.freeshell.org>
In reply to#105723
On 2017-03-10, jameskuyper@verizon.net <jameskuyper@verizon.net> wrote:
> Other possibilities include:
> {-14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
>
> I suspect that this is not what insane_goat meant, but until he
> specifies the problem to be solved more precisely, this seems to
> qualify.

I was assuming that all numbers were meant to be positive integers.

[toc] | [prev] | [next] | [standalone]


#105748

FromJames Kuyper <jameskuyper@verizon.net>
Date2017-03-10 15:21 -0500
Message-ID<o9v1ml$kcf$1@dont-email.me>
In reply to#105738
On 03/10/2017 02:20 PM, Ike Naar wrote:
> On 2017-03-10, jameskuyper@verizon.net <jameskuyper@verizon.net> wrote:
>> Other possibilities include:
>> {-14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
>>
>> I suspect that this is not what insane_goat meant, but until he
>> specifies the problem to be solved more precisely, this seems to
>> qualify.
> 
> I was assuming that all numbers were meant to be positive integers.

My point is that this is only an assumption on your part - it's one of
the many details he left unspecified.

[toc] | [prev] | [next] | [standalone]


#105753

FromIke Naar <ike@iceland.freeshell.org>
Date2017-03-10 20:36 +0000
Message-ID<slrn3vfsoc63mb.4li.ike@iceland.freeshell.org>
In reply to#105748
On 2017-03-10, James Kuyper <jameskuyper@verizon.net> wrote:
> On 03/10/2017 02:20 PM, Ike Naar wrote:
>> On 2017-03-10, jameskuyper@verizon.net <jameskuyper@verizon.net> wrote:
>>> Other possibilities include:
>>> {-14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
>>>
>>> I suspect that this is not what insane_goat meant, but until he
>>> specifies the problem to be solved more precisely, this seems to
>>> qualify.
>> 
>> I was assuming that all numbers were meant to be positive integers.
>
> My point is that this is only an assumption on your part - it's one of
> the many details he left unspecified.

Correct.

[toc] | [prev] | [next] | [standalone]


#105858

Frominsane_goat <nobody@nothing.net>
Date2017-03-12 13:19 +0000
Message-ID<oa3hsu$mge$2@gioia.aioe.org>
In reply to#105748
On 2017-03-10, James Kuyper <jameskuyper@verizon.net> wrote:
> On 03/10/2017 02:20 PM, Ike Naar wrote:
>> On 2017-03-10, jameskuyper@verizon.net <jameskuyper@verizon.net> wrote:
>>> Other possibilities include:
>>> {-14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2,
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
>>>
>>> I suspect that this is not what insane_goat meant, but until he
>>> specifies the problem to be solved more precisely, this seems to
>>> qualify.
>> 
>> I was assuming that all numbers were meant to be positive integers.
>
> My point is that this is only an assumption on your part - it's one of
> the many details he left unspecified.
>
I use unsigned int in my program. I assumed it was quite clear, as only a
complete retard would use unsigned integers when he wanted signed answers.

-- 
Daniel Roskams

[toc] | [prev] | [next] | [standalone]


#105859 — Gotta keep up with the times (Was: Program to find consecutive integers)

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2017-03-12 13:25 +0000
SubjectGotta keep up with the times (Was: Program to find consecutive integers)
Message-ID<oa3i8r$s0q$1@news.xmission.com>
In reply to#105858
In article <oa3hsu$mge$2@gioia.aioe.org>,
insane_goat  <nobody@nothing.net> wrote:
...
>I use unsigned int in my program. I assumed it was quite clear, as only a
>complete retard would use unsigned integers when he wanted signed answers.

I get it, but, point of order, I don't think you're allowed to use the 'R
word' nowadays.  Instead, we use the updated term 'Trump Voter' (or,
equivalently, 'Trump Supporter').  It means the same thing.

It is an interesting theoretical question to consider how much time will
have gone by when these terms are similarly rendered non-acceptable/non-PC.
And, of course, it will be interesting to see what new terms will come into
usage as replacements.

Time alone will tell...

-- 
Kenny, I'll ask you to stop using quotes of mine as taglines.

    - Rick C Hodgin -

[toc] | [prev] | [next] | [standalone]


#105867 — Re: Gotta keep up with the times (Was: Program to find consecutive integers)

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2017-03-12 08:11 -0700
SubjectRe: Gotta keep up with the times (Was: Program to find consecutive integers)
Message-ID<fce42d90-844f-46f9-a04c-0e692b5b8d02@googlegroups.com>
In reply to#105859
On Sunday, March 12, 2017 at 1:25:52 PM UTC, Kenny McCormack wrote:
> In article <oa3hsu$mge$2@gioia.aioe.org>,
> insane_goat  <nobody@nothing.net> wrote:
> ...
> >I use unsigned int in my program. I assumed it was quite clear, as only a
> >complete retard would use unsigned integers when he wanted signed 
> >answers.
> 
> I get it, but, point of order, I don't think you're allowed to use the 'R
> word' nowadays.  Instead, we use the updated term 'Trump Voter' (or,
> equivalently, 'Trump Supporter').  It means the same thing.
> 
When I was at school, the lowest class was called "remedial". It was a
euphemism, but of course it didn't work, as most boys thought the word
meant "especially thick".

[toc] | [prev] | [next] | [standalone]


#105871 — Re: Gotta keep up with the times (Was: Program to find consecutive integers)

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2017-03-12 15:53 +0000
SubjectRe: Gotta keep up with the times (Was: Program to find consecutive integers)
Message-ID<oa3qtc$hp$2@news.xmission.com>
In reply to#105867
In article <fce42d90-844f-46f9-a04c-0e692b5b8d02@googlegroups.com>,
Malcolm McLean  <malcolm.mclean5@btinternet.com> wrote:
>On Sunday, March 12, 2017 at 1:25:52 PM UTC, Kenny McCormack wrote:
>> In article <oa3hsu$mge$2@gioia.aioe.org>,
>> insane_goat  <nobody@nothing.net> wrote:
>> ...
>> >I use unsigned int in my program. I assumed it was quite clear, as only a
>> >complete retard would use unsigned integers when he wanted signed 
>> >answers.
>> 
>> I get it, but, point of order, I don't think you're allowed to use the 'R
>> word' nowadays.  Instead, we use the updated term 'Trump Voter' (or,
>> equivalently, 'Trump Supporter').  It means the same thing.
>> 
>When I was at school, the lowest class was called "remedial". It was a
>euphemism, but of course it didn't work, as most boys thought the word
>meant "especially thick".

I think something like half of all teaching effort in US colleges these
days is "remedial" - i.e., teaching people things they should have learned
in high school (or earlier).

-- 

"If God wanted us to believe in him, he'd exist."

    (Linda Smith on "10 Funniest Londoners", TimeOut, 23rd June, 2005.)

[toc] | [prev] | [next] | [standalone]


#105876 — Re: Gotta keep up with the times (Was: Program to find consecutive integers)

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2017-03-12 10:50 -0700
SubjectRe: Gotta keep up with the times (Was: Program to find consecutive integers)
Message-ID<d21f9712-bba3-4c0f-bbaf-5b1cd84fb95d@googlegroups.com>
In reply to#105871
On Sunday, March 12, 2017 at 3:53:22 PM UTC, Kenny McCormack wrote:
> 
> I think something like half of all teaching effort in US colleges these
> days is "remedial" - i.e., teaching people things they should have learned
> in high school (or earlier).
> 
That's true in the UK too.

A lot of universities are quietly and competently teaching youngsters
things they should have learnt at school and didn't. It's something they
have to keep quiet about, and university education is far more expensive
that state school education, but the universities are selective, so 
the bottom 50%, including the long tail of disruptive elements, are
eliminated. Then 18-21 year olds are in some ways easier to teach 
than younger children because discipline problems present if different, 
more manageable forms. Then, though it's dreadful to have to say this,
an assault on a member of university staff by a student is in the eyes
of the police an adult-to-adult matter, and dealt with as such. Consequently
such actions by students are rare.

[toc] | [prev] | [next] | [standalone]


#105880 — Re: Gotta keep up with the times (Was: Program to find consecutive integers)

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2017-03-12 18:25 +0000
SubjectRe: Gotta keep up with the times (Was: Program to find consecutive integers)
Message-ID<oa43rf$6kc$1@news.xmission.com>
In reply to#105876
In article <d21f9712-bba3-4c0f-bbaf-5b1cd84fb95d@googlegroups.com>,
Malcolm McLean  <malcolm.mclean5@btinternet.com> wrote:
>On Sunday, March 12, 2017 at 3:53:22 PM UTC, Kenny McCormack wrote:
>> 
>> I think something like half of all teaching effort in US colleges these
>> days is "remedial" - i.e., teaching people things they should have learned
>> in high school (or earlier).
>> 
>That's true in the UK too.
>
>A lot of universities are quietly and competently teaching youngsters
>things they should have learnt at school and didn't. It's something they
>have to keep quiet about, and university education is far more expensive
>that state school education, but the universities are selective, so the
>bottom 50%, including the long tail of disruptive elements, are
>eliminated. Then 18-21 year olds are in some ways easier to teach than
>younger children because discipline problems present if different, more
>manageable forms. Then, though it's dreadful to have to say this, an
>assault on a member of university staff by a student is in the eyes of the
>police an adult-to-adult matter, and dealt with as such. Consequently such
>actions by students are rare.

Interesting stuff.  I'm assuming:

    1) That by 'present if different', you meant 'present in different'.

    2) That the UK has evolved the same "everybody goes to college" mindset
	as the US.  Such that everybody assumes that if you don't go to
	college, the only job you'll ever have is flipping burgers.  I
	imagine that it won't be that much longer until you can't get a job
	flipping burgers w/o a college degree.

(Moving onto a new, but related topic)
Paul Graham's thesis is that all education below college level is just
"warehousing" - i.e., day care.

-- 
The randomly chosen signature file that would have appeared here is more than 4
lines long.  As such, it violates one or more Usenet RFCs.  In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
	http://user.xmission.com/~gazelle/Sigs/God

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.c


csiph-web