F-Number theory

Source: Internet
Author: User

The question of the coprime, the beginning of the topic is not how to read, then went to Baidu a bit, read some problem-solving report, and then have the idea, and then try to write slowly

#include <iostream>  #include <algorithm>  using namespace std;    int gcd (int n,int m)  {      while (n%m!=0)      {          int temp;          temp=m;          m=n%m;          n=temp;      }      return m;  }    int main ()  {      int t,n,m;      while (scanf ("%d", &t)!=eof)      {while          (t--)          {              scanf ("%d%d", &n,&m);              if (n<m)                  swap (n,m);              int FLAG=GCD (n,m);              if (flag==1)                  printf ("no/n");              else                  printf ("yes/n");          }      }      return 0;  }  

  

F-Number theory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.