| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 512 人关注过本帖
标题:手机编译出了一大串错误,请大家指教
取消只看楼主 加入收藏
编程Samuel
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2015-1-6
结帖率:50%
收藏
已结贴  问题点数:5 回复次数:0 
手机编译出了一大串错误,请大家指教
如下代码#include <stdio.h>
#include <stdlib.h>
int main(void)
{
     int i=0,a,b,c,n;
     char ch;
     scanf("%d",&n);
     for(i=0;i<n;i++)
     {
     scanf("%d %c %d",&a,&ch,&b);
        switch(ch)
      {
        case '+':{c=a+b;printf("%d\n",c);break;}
        
         case '-':{c=a-b;printf("%d\n",c);break;}
        case '*':{c=a*b;printf("%d\n",c);break;}
        case '/':{c=a/b;printf("%d\n",c);break;}
       }
     }
  return 0;
}
Compiling your program...

prog.c: In function 'main':
prog.c:13:9: error: stray '\357' in program
         case '+':{c=a+b;printf("%d\n",c);break;}
         ^
prog.c:13:9: error: stray '\274' in program
prog.c:13:9: error: stray '\232' in program
prog.c:13:20: error: expected ':' or '...' before '{' token
         case '+':{c=a+b;printf("%d\n",c);break;}
                    ^
prog.c:15:10: error: stray '\357' in program
          case '-':{c=a-b;printf("%d\n",c);break;}
          ^
prog.c:15:10: error: stray '\274' in program
prog.c:15:10: error: stray '\232' in program
prog.c:15:21: error: expected ':' or '...' before '{' token
          case '-':{c=a-b;printf("%d\n",c);break;}
                     ^
prog.c:16:9: error: stray '\357' in program
         case '*':{c=a*b;printf("%d\n",c);break;}
         ^
prog.c:16:9: error: stray '\274' in program
prog.c:16:9: error: stray '\232' in program
prog.c:16:20: error: expected ':' or '...' before '{' token
         case '*':{c=a*b;printf("%d\n",c);break;}
                    ^
prog.c:17:9: error: stray '\357' in program
         case '/':{c=a/b;printf("%d\n",c);break;}
         ^
prog.c:17:9: error: stray '\274' in program
prog.c:17:9: error: stray '\232' in program
prog.c:17:20: error: expected ':' or '...' before '{' token
         case '/':{c=a/b;printf("%d\n",c);break;}
搜索更多相关主题的帖子: include return 手机 
2015-01-08 15:23
快速回复:手机编译出了一大串错误,请大家指教
数据加载中...
 
   



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

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