一道C语言题,帮下谢谢

2024-12-13 21:36:03
推荐回答(1个)
回答1:

#include
void find(int num)
{
int a[11][2]={{801,601},{802,99},{808,608},{810,609},{814,614},{823,623},{826,626},{836,617},{846,619},{849,620},{852,621}};
int i;
for(i=0;i<11;i++)
{
if(a[i][0]==num)
{
printf("%d ", a[i][1]);
break;
}
}
}
int main()
{
int n,i;
int num[100]={0};
scanf("%d", &n);
for(i=0;i {
scanf("%d", &num[i]);
}
for(i=0;i {
if(num[i]>800 && num[i]<900)
{
find(num[i]);
}
else
printf("%d ", num[i]);
}
printf("\n");
return 0;
}