Browse Source

简单的A+B

爱玲姐姐 5 years ago
parent
commit
676bd12924
1 changed files with 18 additions and 0 deletions
  1. 18 0
      A.cpp

+ 18 - 0
A.cpp

@@ -0,0 +1,18 @@
+#include<bits/stdc++.h>
+using namespace std;
+int main(){
+    long long A,B,C,sum=0;
+    char c1,c2;
+    while(~scanf("%lld%c%lld%c%lld",&A,&c1,&B,&c2,&C)){
+         if(c1=='+'){
+            if(A+B==C)
+                sum++;
+         }
+         else if(c1=='-'){
+            if(A-B==C)
+                sum++;
+         }
+  
+    }
+    cout<<"RIGHT:"<<sum<<endl;
+}