+ 1
why this code ain't working?
5 ответов
+ 7
This works.
#include <iostream>
using namespace std;
int main(){
double a,c,d;
char b;
cin>>a;
cin>>b;
cin>>c;
if(b=='+'){
d=a+c;
}
if(b=='*'){
d=a*c;
}
if(b=='-'){
d=a-c;
}
if(b=='/'){
d=a/c;
}
cout<<d;
return 0;
}
+ 11
You missed some semicolons and you used some special characters in place of comma and open parantheses at some places.
+ 7
C++ always uses a semicolon behind.
+ 2
thanks. it does now. I don't know why it wasn't working 😱😱
0
thanks