C语言问题

[复制链接]
查看11 | 回复1 | 2011-5-10 17:25:31 | 显示全部楼层 |阅读模式
问题 314 分
保存

12.补足程序,实现如下功能:从键盘上输入若干个学生的成绩,统计并输出最高成绩和最低成绩,当输入负数时结束输入。
void main()
{ floatscore, max=0, min=100;
printf(“ Input the score”);
scanf( “ %f”, &score);
while (
(1)
)
{if ( score > max)max=score;

if (
(2)
)min=score;

printf(“ Input the score”);

scanf( “ %f”, &score);
}
printf(“ Themaxscoreis%f\nminis%f\n”,max, min);
}
问题 324 分
保存

13.以下程序的功能是实现从键盘输入一组字符,统计出大写字母的个数m和小写字母的个数n,并输出m、n中的较大者。
voidmain()
{ intm= 0, n=0;
char c;
while ( (
(1)
) != ‘\n’ )
{if( c>=’A’ &&c =’a’ &&c
void main()
{charstr[]="1a2b3c" ;int i;
for (i=0; str!='\0';i++)

if (str>='0'&&str
void main()
{charstr[][10]={"ABCD","EFGH","IJKL","MNOP"},k;
for (k=1; kint main(){ int month[13] = { 0, 31, 28, 31, 30, 31, 30,31, 31, 30, 31, 30, 31 }; int y, m, d; int i, day; int special_year; scanf("%d%d%d", &y, &m, &d); if(y % 400 == 0 || y % 1
回复

使用道具 举报

千问 | 2011-5-10 17:25:31 | 显示全部楼层
12、(1) score>=0 (2)score=0 (2)score=7)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行