Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x, y, m, n, m1, n1, m2=0, n2=0, j=0, l=0, k=0, g=0;
- for(int i=1; i<=3; i++)
- {
- cin >> x >> y;
- if(x>k)k = x;
- if(y>g)g = y;
- m = x;
- n = y;
- while(m>0)
- {
- m1 = m%10;
- m/=10;
- m2+=m1;
- }
- while(n>0)
- {
- n1 = n%10;
- n/=10;
- n2+=n1;
- }
- if(x%m2 == 0)
- {
- j+=2;
- l--;
- }
- if(y%n2 == 0)
- {
- l+=2;
- j--;
- }
- m2 = 0;
- n2 = 0;
- }
- cout << j << " " << l << endl;
- if(j==l)
- {
- if(k>g)cout << "Stefan";
- else cout << "Ana";
- }
- else
- {
- if(j>l)cout << "Stefan";
- else cout << "Ana";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment