askarulytarlan

спираль

Oct 5th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cmath>
  4. #include <math.h>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int n;
  10.  
  11. int main(int argc, const char * argv[]) {
  12.  
  13. cin >> n;
  14. int k = n - 2;
  15. int c = n * 3 - 2 + k;
  16. for (int i = 1 ; i <= 1 ; i++ ){
  17. for(int j = 1 ; j <= n ; j++ ){
  18. cout << j << " " ;
  19. }
  20. cout << endl ;
  21. for(int d = c; d <= c + k; d++){
  22. cout<< d << " ";
  23. }
  24. cout << n + 1;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment