Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- char finalSector;
- cin >> finalSector;
- int rows, oddSeats, totalSeats = 0;
- cin >> rows >> oddSeats;
- for (char i = 'A'; i <= finalSector; i++) {
- for (int k = 1; k <= rows; k++) {
- int currentSeats = oddSeats;
- if (k % 2 == 0) {
- currentSeats += 2;
- }
- for (char o = 'a'; o < currentSeats + 97; o++) {
- cout << i << k << o << endl;
- totalSeats++;
- }
- }
- rows++;
- }
- cout << totalSeats << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement