SHARE
TWEET

Untitled

a guest Dec 3rd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. int main()
  5. {
  6.     int i;
  7.     int n;
  8.     scanf("%d",&n);
  9.     int *a;
  10.     a = (int*)malloc(n*sizeof(char));
  11.     if(a==NULL)
  12.     {
  13.         return 1;
  14.     }
  15.     getchar();
  16.     size_t p = strlen(a);
  17.     for(i=0;i<p;i++)
  18.     {
  19.         scanf("%d",&a[i]);
  20.     }
  21.     for (i=0;i<p;i++)
  22.     {
  23.         printf("a[%d] = ",i);
  24.         printf("%d\n",a[i]);
  25.     }
  26.     free(a);
  27.     return 0;
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top