We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b60e349 commit c9f06c8Copy full SHA for c9f06c8
1 file changed
A(A+B).cpp
@@ -0,0 +1,38 @@
1
+/*
2
+ yildiz
3
+*/
4
+#include <string>
5
+#include <iostream>
6
+#include <cmath>
7
+#include <algorithm>
8
+#include <vector>
9
+using namespace std;
10
+int main() {
11
+ int t;
12
+ cin >> t;
13
+
14
+ while (t--) {
15
+ string s;
16
+ cin >> s;
17
+ int c = s[0] - '0';
18
+ char ch = s[1];
19
+ int y = s[2] - '0';
20
21
+ switch (ch) {
22
+ case '+':
23
+ cout << (y + c) << "\n";
24
+ break;
25
+ case '-':
26
+ cout << (y - c) << "\n";
27
28
+ case '*':
29
+ cout << (y * c) << "\n";
30
31
+ case '/':
32
+ cout << (y / c) << "\n";
33
34
+ }
35
36
37
+ return 0;
38
+}
0 commit comments