输入一连串数字,遇到回车就停止输入

/*输入一连串数字,遇到回车就停止输入*/ 


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main()
{
    int a[101];
    int i=0,j=0,k=0,z=0;
    do{
        i++;
        scanf("%d",&a[i]);
        printf("%d
",a[i]) ;
    } while(getchar()!='
');    //如果遇到回车就停止 输入 
} 
》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》
原文地址:https://www.cnblogs.com/ssws/p/13220778.html