Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int N=1000005,crivo[1000005];
- int main()
- {
- string s1,s2;
- int a=0,c=0;
- double ans;
- cin >> s1;
- cin >> s2;
- for (int i=0;i<s1.size();i++)
- {
- if (s1[i]=='+')
- a++;
- else if (s1[i]=='-')
- a--;
- else if (s1[i]=='?')
- c++;
- }
- for (int i=0;i<s2.size();i++)
- {
- if (s2[i]=='+')
- a--;
- else if (s2[i]=='-')
- a++;
- else if (s2[i]=='?')
- c++;
- }
- if (c==0)
- {
- if (a==0)
- {
- ans=1;
- }
- else
- {
- ans=0;
- }
- printf("%lf",ans);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement