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