输入数字如何获取
1、c++
int
n[101],m[101],result[101];
int
i=0,j=0,k=0,Ncount=0,Mcount=0;
while
(
scanf
(
"%d"
,&Ncount)!=EOF)
{
for
(i=0;i<Ncount;i++)
//读入数组N
{
scanf
(
"%d"
,&n[i]);
}
scanf
(
"%d"
,&Mcount);
if
(Mcount>Ncount)
continue
;
//m内的数多于n内的数,不符合输入准则
for
(j=0;j<Mcount;j++)
//读入数组m并查找
{
scanf
(
"%d"
,&m[j]);
result[j]=0;
//result初始化为0
。。。。
while
(
scanf
(
"%d"
, &n)!=EOF)
{
for
(
int
i=1;i<=n;i++)
{
scanf
(
"%d"
, &a[i]);
}
scanf
(
"%d"
, &m);
for
(
int
i=1;i<=m;i++)
{
scanf
(
"%d"
, &b[i]);
}