Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #include <string.h>
- using namespace std;
- int main() {
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- char line[100];
- cout << "Введите строку: ";
- gets_s(line);
- char ch;
- cout << "Введите символ: ";
- cin >> ch;
- for (int i = 0; i < strlen(line); i++) {
- if (line[i] == ch) {
- cout << i + 1 << " ";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement