#include<stdio.h>
int main()
{
int id, b[40], n = 0, i;
long a[40];
for (i = 0;; i++)
{
printf("Input student’s ID and score:");
scanf("%ld%d", &a[i], &b[i]);
if (a[i] >0|| b[i] > 0)
n++;
else
break;
}
printf("Total students are %d\n", n);
printf("Input the searching ID:");
scanf("%ld", &id);
for (i = 0; i < n; i++)
{
if (id == a[i])
{
printf("score = %d\n", b[i]);
break;
}
}
if (i == n)
{
printf("Not found!\n");
}
return 0;
}
05-11
8761
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交