Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <sstream>
- #include <fstream>
- using namespace std;
- int main(int argc, char* argv[])
- {
- setlocale(LC_ALL, "Russian");
- cout << "There are " << argc << " arguments:\n";
- // Перебираем каждый аргумент и выводим его порядковый номер и значение
- char alf[] = { "абвгдеёжзийклмнопрстуфхцчшщъыьэюя" };
- int count[33]{ NULL };
- for (int i = 0; i < argc; ++i)
- cout << i << ": " << argv[i] << '\n';
- for (int t = 0; t < argc; ++t) {
- for (int i = 0; argv[t][i] != NULL; i++) {
- for (int j = 0; j < 33; j++) {
- if (argv[t][i] == alf[j]) {
- count[j]++;
- }
- }
- }
- }
- for (int i = 0; i < 33; i++) {
- cout << alf[i] << " - " << count[i] << endl;
- }
- return 0;
- }
Advertisement
Advertisement