its A with 1 then B 3 time with 1-3 the A with 2 then B again with 1-3
the b with 1-3 is the inner loop i know that and the A with 1 and 2 every 3 times
i think??
// Example program
#include <iostream>
int main()
{
int iterations = 0;
std::cout << "How many times would you like the sequence to repeat? ";
std::cin >> iterations;
//The loops start at 1 instead of 0 because it doesn't seem
//logical to add one every time you loop just to output :P
for(int i = 1; i <= iterations; ++i) //a1-aITERATIONS
{
std::cout << 'A' << i;
for(int j = 1; j <= 3; ++j) //b1-b3
{
std::cout << 'B' << j;
}
}
return 0;
}
How many times would you like the sequence to repeat? 10
A1B1B2B3A2B1B2B3A3B1B2B3A4B1B2B3A5B1B2B3A6B1B2B3A7B1B2B3A8B1B2B3A9B1B2B3A10B1B2B3
:P See you just posted right before me with almost identical solution good job!
If you look at the time stamps mine was posted 1 minute after yours :P so when I was typing it that one wasn't there and the first one didn't have a nested loop.