Advertisement
STANAANDREY

9bac 43

Jan 21st, 2019
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. unsigned n,a,b,nrok,x;
  8. nrok=0;
  9. cout<<"n=";cin>>n;
  10. cout<<"a=";cin>>a;
  11. cout<<"b=";cin>>b;
  12. for (x=a;x<=n;x+=a)
  13. {
  14. if (x%b!=0)
  15. nrok++;
  16. }
  17. cout<<nrok;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement