1 solutions
-
0
C++ :
#include<bits/stdc++.h> using namespace std; char s,s1,fh; int a,b; int main() { cin>>s; if(s=='-') {cin>>s1;a=-(int(s1)-48);} else a=int(s)-48; cin>>fh>>s; if(s=='-') {cin>>s1;b=-(int(s1)-48);} else b=int(s)-48; if(fh=='+') cout<<a+b; if(fh=='-') cout<<a-b; if(fh=='*') cout<<a*b; if(fh=='/') if(b==0) cout<<"NO"; else cout<<a/b; return 0; }
- 1
Information
- ID
- 1068
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By