Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <iostream>
- using namespace std;
- #include <iomanip>
- #include <math.h>
- #include <cmath>
- #include <string>
- int main()
- {
- int floors;
- cin >> floors;
- int rooms;
- cin >> rooms;
- int counter = floors;
- char letter;
- while (counter > 0) {
- if (floors == 1) {
- letter = 'L';
- for (int i = 0; i < rooms; i++) {
- cout << letter << counter << i << " ";
- }
- break;
- }
- if (counter == floors) {
- letter = 'L';
- for (int i = 0; i < rooms; i++) {
- cout << letter << counter << i << " ";
- }
- counter -= 1;
- }
- cout << endl;
- if (counter % 2 == 1) {
- letter = 'A';
- for (int i = 0; i < rooms; i++) {
- cout << letter << counter << i << " ";
- }
- }
- else {
- letter = 'O';
- for (int i = 0; i < rooms; i++) {
- cout << letter << counter << i << " ";
- }
- }
- counter -= 1;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment