Guest User

Untitled

a guest
Mar 24th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <iostream>
  3. #include <queue>
  4. using namespace std;
  5.  
  6. int main() {
  7. queue<int> q;
  8. int n, m, i,j;
  9. cin >> n >> m;
  10. for (i = 1; i <= n; i++) {
  11. q.push(i);
  12. }
  13. printf("<");
  14. for (i = 0; i < n - 1; i++) {
  15. for (j = 0; j < m - 1; j++) {
  16. q.push(q.front());
  17. q.pop();
  18. }
  19. printf("%d, ", q.front());
  20. q.pop();
  21. }
  22. printf("%d>", q.front());
  23.  
  24.  
  25. return 0;
  26. }
Add Comment
Please, Sign In to add comment