Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- int main()
- {
- int ans(0), N(0), M(0);
- ifstream ifs("forcycle.in");
- ifs >> N >> M;
- ifs.close();
- for (int i = 1; i <= N; i++)
- ans += (i % M);
- ofstream ofs("forcycle.out");
- ofs << ans;
- ofs.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment