Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- long long number,a,b,x;
- cin>>number;
- for(int i=0;i<number;i++){
- cin>>a>>b;
- if(a==0||b==0||a==1||b==1){
- if((a+b)%2==1)
- cout<<">//<"<<endl;//阿輝
- else
- cout<<">\\\\<"<<endl;//小莫
- }
- else if((a%2==0&&b%2==1)||(a%2==1&&b%2==0))//一奇一偶
- cout<<">//<"<<endl;
- else if(a%2==1&&b%2==1)//雙奇數
- cout<<">\\\\<"<<endl;
- else if(a==b)//已把奇數全部排除,同偶數
- cout<<">//<"<<endl;
- else {
- for(x=0;a!=b;x++){
- if(a>b)
- a-=b;
- else if(b>a)
- b-=a;
- }
- if(x%2==1)
- cout<<">\\\\"<<endl;
- else
- cout<<">//<"<<endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement