|
#include <stdio.h>
int main ()
{
int i, n;
char * p = NULL;
printf ("please input a number:");
scanf ("% d",&n);
p = (char *) malloc (n + 1);
for (i = 0; i <n; i ++)
{
* (p + i) = n-i + '0';
}
* (p + n) = '\0';
for (i = 0; i <n; i ++)
{
printf (p + (n-i-1));
printf ("\n");
}
} |
|