Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Решение с for:
- #include <iostream>
- using namespace std;
- int main() {
- for (int i = 1; i < 11; i++) {
- cout << i << endl;
- }
- return 0;
- }
- Решение с while:
- #include <iostream>
- using namespace std;
- int main() {
- int num = 1;
- while (num < 11) {
- cout << num << endl;
- num++;
- }
- return 0;
- }
- Решение с do/while:
- #include <iostream>
- using namespace std;
- int main() {
- int num = 1;
- do {
- cout << num << endl;
- num++;
- } while (num < 11);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement