| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 513 人关注过本帖
标题:那些bug,大神帮帮窝
取消只看楼主 加入收藏
Chelsey
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2015-7-23
结帖率:66.67%
收藏
已结贴  问题点数:20 回复次数:1 
那些bug,大神帮帮窝
#include<iostream>
using  namespace std ;
int main()
{
    int first_num;
    int second_num;
    int sign;
    cout<<"enter the first_number:"<<'\n';
    cin>> first_num;
    cout<<"enter the second_number:"<<'\n';
    cin>>second_num;
    cout<<"enter the arithmetic sign :"<<'\n';
    cin>>sign;
    if ( sign== + )
    {
        cout<<first_num<<"+"<<second_num<<"="<<first_num + second_num<<endl;
    }
    else if(sign==-)
    {
        cout<<first_num<<"-"<<second_num<<"="<<first_num - second_num<<endl;
    }
    else if(sign==*)
    {
        cout<<first_num<<"*"<<second_num<<"="<<first_num * second_num<<endl;
    }
   else(sign==/);
    {
        cout<<first_num<<"/"<<second_num<<"="<<first_num / second_num<<endl;
        return 0;
    }
}
报错是:
||=== Build: Debug in 入门练习 (compiler: GNU GCC Compiler) ===|
D:\软件\C++\C++文件\入门练习\main.cpp||In function 'int main()':|
D:\软件\C++\C++文件\入门练习\main.cpp|14|error: expected primary-expression before ')' token|
D:\软件\C++\C++文件\入门练习\main.cpp|18|error: expected primary-expression before ')' token|
D:\软件\C++\C++文件\入门练习\main.cpp|22|error: expected primary-expression before ')' token|
D:\软件\C++\C++文件\入门练习\main.cpp|26|error: expected primary-expression before '/' token|
D:\软件\C++\C++文件\入门练习\main.cpp|26|error: expected primary-expression before ')' token|
||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

没有弄明白为什么那个地方有错*_*

还有有时候莫名其妙的会报错else if前面应该先用if,可是我用过if了呀。。。网上有人说可能是没有大括号,我加了还是不行T_T
就是有时候好好的有时候会报错,但找不到错跟没错有什么不一样的地方
搜索更多相关主题的帖子: second include 
2015-07-23 21:49
Chelsey
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2015-7-23
收藏
得分:0 
回复 2楼 hjx1120
问题解决啦....
蟹蟹*_*
2015-07-24 16:43
快速回复:那些bug,大神帮帮窝
数据加载中...
 
   



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

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