解题思路:
注意事项:
参考代码
#include<stdio.h>
int main()
{
int a[9];
int temp,m,i;
for(i=0; i<9; i++)
{
scanf("%d",&a[i]);
}
scanf("%d",&temp);
if(temp<=a[0]) m=0;
else if(temp>=a[8]) m=1;
else m=2;
switch(m)
{
case 0:
printf("%d\n",temp);
for(i=0; i<9; i++)
{
printf("%d\n",a[i]);
}
break;
case 1:
for(i=0; i<9; i++)
{
printf("%d\n",a[i]);
}
printf("%d\n",temp);
break;
case 2:
for(i=0; i<9; i++)
{
printf("%d\n",a[i]);
if(temp>=a[i]&&temp<a[i+1])
{
printf("%d\n",temp);
}
}
break;
}
}
:
0.0分
0 人评分
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:1225 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:544 |
模拟计算器 (C语言代码)浏览:880 |
C语言训练-求具有abcd=(ab+cd)2性质的四位数 (C语言代码)浏览:560 |
不容易系列2 (C语言代码)浏览:589 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:742 |
ASCII帮了大忙浏览:748 |
C语言考试练习题_排列 (C语言代码)浏览:718 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:451 |
完数 (C语言代码)浏览:685 |