All pastes #805490 Raw Edit

Something

public c v1 · immutable
·published 2007-12-04 12:26 UTC
rendered paste body
#include <stdio.h>#include <math.h>#include "bc.h"int main (void){	int N;	clrscr ();	printf ("Enter number of elements: ");	scanf ("%d", &N);	if  (N <= 0 || N > 1000)	{		printf ("Are you trying to mess me?..\n");		exit (1);	}	int *A = (int *) malloc (N * sizeof (int));	int i;	srand (time (NULL));	for (i = 0; i < N; i++)		A[i] = rand () % 15;	for (i = 0; i < N; i++)		printf ("%d (%d)\t", A[i], i);	printf ("\n");	for (i = 0; i < N; i++)		if (A[i] < i)			A[i] *= A[i];		else			if (A[i] == i)				A[i] *= -1;			else				A[i] -= 1;		for (i = 0; i < N; i++)			printf ("%d     \t", A[i]);	free (A);	printf ("\nAll done.");	getch ();	return 0;}