Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- long long a, b, cnt = 0, x, r;
- cin>>b;
- while(b)
- {
- cin>>a;
- x = a;
- if(a)
- {
- while(b)
- {
- r = x % b;
- x = b;
- b = r;
- }
- if(x==1) cnt++;
- }
- b = a;
- }
- cout<<cnt;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement