Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;// ||
- int main () {
- int n,i,k,a,b,x,y;
- cout<<"n=";cin>>n;
- k=0;
- i=0;
- while (i<n)
- {
- cin>>a>>b;
- x=a;
- y=b;
- while (x!=y)
- if (x>y)
- x-=y;
- else
- y-=x;
- if (x==1)
- k++;
- i++;
- }
- cout<<"nr perechi= "<<k;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement