Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- void main()
- {
- int n = 9, m = 6;
- int Du = 1;
- int Thuong = 1;
- int k = 0;
- for ( int i = 1; i <= n; i++)
- {
- Thuong = Du * i /m;
- Du = (Du * i ) % m;
- if ( Du == 0)
- {
- k++;
- Du = Thuong;
- }
- }
- std::cout << k;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement