Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<iostream>
#include<string>
using namespace std;
int main(){
int n;
cin>>n;
string s;
int x = 0;
for(int i = 0; i < n; i++){
cin>>s;
if(s == "++X" || s == "X++"){
x++;
}
else{
x--;
}
}
cout<<x;
return 0;
}
Copy The Code &
Try With Live Editor
Input
1
++X
++X
Output
1
Demonstration
Codeforcess Solution 282-A A. Bit++ ,,C++, Java, Js and Python,282-A,Codeforcess Solution