关于输出错误的问题(新手求教)

自己写的一个程序,想请教各位大佬,为什么输出结果,一直为0

图片说明
图片说明

你把printf( )放到if语句的内层去试试

接收输入的时候格式化符号用错了,改成如下这样:

 while(scanf("%lf %lf %c", &a, &b, &s)!=EOF)

#include "stdafx.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double a,b,c;
char s;
while(1)
{
cin>>a>>b>>s;
switch(s)
{
case '+':c=a+b;break;
case '-':c=a-b;break;
case '*':c=a+b;break;
case '/':c=a+b;
}
cout<<endl<<c<<endl;
}

return 0;

}
这是我用C++写的,对照着看看,我怎么觉得是你输入有问题,scanf("%lf%lf%c",&a,&b,&s);

进入调试 按下f10 看看那你的值有没有输入进去