Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <locale>
- using namespace std;
- void main()
- {
- setlocale(LC_ALL, "Russian");
- string numbers/* = "A123AA50 A435BB20 C413KA150 E184PO90 A372OP50 K562AP55 H555HH50 X987EH89 P234EX150 X778YO777 "*/;
- char s1[10];
- char s2[2];
- s1[9] = '\0';
- cout << "Введите номера" << endl;
- getline(cin, numbers);
- /*cout << "Список номеров:" << endl;
- cout << endl;
- cout << numbers << endl;*/
- cout << "Список номеров Подмосковья" << endl;
- cout << endl;
- while (numbers.length() > 0) {
- numbers.copy(s1, 9, 0);
- if (s1[8] == ' ') {
- numbers.erase(0, 9);
- s2[0] = s1[6];
- s2[1] = s1[7];
- }
- else {
- numbers.erase(0, 10);
- s2[0] = s1[7];
- s2[1] = s1[8];
- }
- if ((s2[0] == '5' || s2[0] == '9') && (s2[1] == '0'))
- cout << s1 << endl;
- }
- system("pause");
- }
Add Comment
Please, Sign In to add comment