标题:求教一下哪里错了,看不出来,初学者谢谢
取消只看楼主
低调的男人
Rank: 1
来 自:中国
等 级:新手上路
帖 子:4
专家分:0
注 册:2015-10-25
结帖率:100%
已结贴  问题点数:2 回复次数:0 
求教一下哪里错了,看不出来,初学者谢谢
#include "stdafx.h"
#include<iostream>
using namespace std;
int main()
{
    int x;
    cin>>x;
    x=x/10;
    if(x>=0&&x<5,x=5)
    switch(x)
    {
        case 10;
    case 9;cout<<"A"<<endl;break;
        case 8;
            case 7;cout<<"B"<<endl;break;
            case 6;cout<<"C"<<endl;break;
                case 5;cout<<"D"<<endl;break;}
    else
    {cout<<"输入错误"<<endl;}
}
1>  gjnfg.cpp
1>c:\users\administrator\documents\visual studio 2010\projects\gjnfg\gjnfg\gjnfg.cpp(14): error C2143: 语法错误 : 缺少“:”(在“;”的前面)
1>c:\users\administrator\documents\visual studio 2010\projects\gjnfg\gjnfg\gjnfg.cpp(15): error C2143: 语法错误 : 缺少“:”(在“;”的前面)
1>c:\users\administrator\documents\visual studio 2010\projects\gjnfg\gjnfg\gjnfg.cpp(16): error C2143: 语法错误 : 缺少“:”(在“;”的前面)
1>c:\users\administrator\documents\visual studio 2010\projects\gjnfg\gjnfg\gjnfg.cpp(17): error C2143: 语法错误 : 缺少“:”(在“;”的前面)
1>c:\users\administrator\documents\visual studio 2010\projects\gjnfg\gjnfg\gjnfg.cpp(18): error C2143: 语法错误 : 缺少“:”(在“;”的前面)
1>c:\users\administrator\documents\visual studio 2010\projects\gjnfg\gjnfg\gjnfg.cpp(19): error C2143: 语法错误 : 缺少“:”(在“;”的前面)
2015-10-25 15:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-458542-1-1.html




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

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