| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1038 人关注过本帖
标题:作业 自己编的 查不出错 求助
取消只看楼主 加入收藏
huangcao
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2008-10-10
结帖率:100%
收藏
 问题点数:0 回复次数:3 
作业 自己编的 查不出错 求助
#include <stdio.h>
void main()
{float score;
char grade;
printf("请输入学生成绩:");
scanf("%f",&score);
while(score>100|| score<0);
{printf("\n 输入有误,请重新输入");
scanf("%f",&score);
}
switch((int)(score/10)
{
case 10:
case 9: grade="A";break;
case 8: grade="B";break;
case 7: grade="C";break;
case 6: grade="D";break;
case 5: grade="E";break;
case 4: grade="E";break;
case 3: grade="E";break;
case 2: grade="E";break;
case 1: grade="E";break;
}
printf("成绩是%5.1f,相应的等级是%c。\n",score,grade);
}
搜索更多相关主题的帖子: 作业 
2008-11-17 14:37
huangcao
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2008-10-10
收藏
得分:0 
还是出错
--------------------Configuration: fdsaf - Win32 Debug--------------------
Compiling...
fsdaf.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\fdsaf\fsdaf.cpp(14) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio\MyProjects\fdsaf\fsdaf.cpp(15) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio\MyProjects\fdsaf\fsdaf.cpp(16) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio\MyProjects\fdsaf\fsdaf.cpp(17) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio\MyProjects\fdsaf\fsdaf.cpp(18) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio\MyProjects\fdsaf\fsdaf.cpp(19) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio\MyProjects\fdsaf\fsdaf.cpp(20) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio\MyProjects\fdsaf\fsdaf.cpp(21) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio\MyProjects\fdsaf\fsdaf.cpp(22) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
执行 cl.exe 时出错.

fsdaf.obj - 1 error(s), 0 warning(s)
2008-11-17 14:46
huangcao
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2008-10-10
收藏
得分:0 
那该怎么改了··
2008-11-17 15:35
huangcao
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2008-10-10
收藏
得分:0 
谢谢了
2008-11-17 16:27
快速回复:作业 自己编的 查不出错 求助
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.048178 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved