weironghui133
weironghui133
2017-09-21 12:55

C语言中数组的输如和输出问题

  • c
#define LENG 100
#include<stdio.h>
#include<stdlib.h>

int main(){
    int LA[LENG];
    int LB[LENG];
    int *p,*q;
    p = (int *)malloc(LENG*sizeof(int));
    q = (int *)malloc(LENG*sizeof(int));
    p = LA;
    q = LB;
    char a;
   printf("请输入一个数组LA:");
   while(1){
       scanf("%d",*p++);
       if(a == '\n')
           break;
   }
   intf("请输入一个数组LB:");
   while(1){
       scanf("%d",*q++);
       if(a == '\n')
           break;
   }
   for(int i = 0;i<(sizeof(LA)/sizeof(int));i++){
       printf("%d",LA[i]);
   }
   for(int j = 0;j<(sizeof(LB)/sizeof(int));j++){
       printf("%d",LB[i]);
   }

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答