Advertisement
askarulytarlan

матрица квадратов

Nov 25th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <ios>
  3. #include <ostream>
  4. #include <cmath>
  5.  
  6. using namespace std;
  7.  
  8. int n;
  9. int main() {
  10. cin >> n;
  11. for(int i = 1; i <= 4; i++){
  12. if(i % 2 == 1){
  13. for(int j = 3; j >= 0; j--){
  14. cout << pow(n+j,2) << " ";
  15. }
  16. cout << endl;
  17. }
  18. else{
  19. for(int j = 0; j <= 3; j++){
  20. cout << pow(n+j,2) << " ";
  21. }
  22. cout << endl;
  23. }
  24. n = n + 4;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement