Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #include <locale>
- #include <iomanip>
- using namespace std;
- void main() {
- setlocale(LC_ALL, "Russian");
- int input = 1;
- while (true) {
- cout << "Введите число (0 - окончание программы): ";
- cin >> input;
- while (input < 0 || input > 20) {
- cout << "Введите число от 1 до 20: ";
- cin >> input;
- }
- if (input == 0) { break; }
- cout << "Число " << setw(10) << "Квадрат" << endl;
- for (int i = 1; i <= input; i++) {
- cout << i << setw(10) << i * i << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement