Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using std::cout;
- using std::cin;
- using std::endl;
- void main()
- {
- setlocale(LC_ALL, "Russian");
- int a, temp;
- cout << "Введите размер шахматной доски: "; cin >> a;
- for (int i = 0; i < a; i++)
- {
- for (int j = 1; j < a + 1; j++)
- {
- temp = (i + j) % 2;
- if (temp == 1) cout << '+' << " ";
- else cout << '-' << " ";
- }
- cout << endl;
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement