Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- string input;
- cin >> input;
- while (input != "Stop") {
- cout << input << endl;
- cin >> input;
- }
- return 0;
- }
- Решение с for:
- #include <iostream>
- using namespace std;
- int main() {
- string input;
- cin >> input;
- for (int i = 0; i < 2147483647; i++) { // INT_MAX = 2147483647
- if (input == "Stop") {
- break;
- }
- cout << input << endl;
- cin >> input;
- }
- return 0;
- }
- ИЛИ:
- #include <iostream>
- using namespace std;
- int main() {
- string input;
- cin >> input;
- for (int i = 0; i < 2147483647 && input != "Stop"; i++) {
- cout << input << endl;
- cin >> input;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement