Okay, so here’s my solution to the “Bytelandian gold coins” problem.
#include <iostream>
using namespace std;
int main()
{
unsigned int n;
unsigned int n_dollars;
int i = 0;
while(i < 8)
{
cin >> n;
if(n>=1000000000 || n<=0)break;
n_dollars = (13 * n)/12;
cout << n_dollars << endl << endl;
}
return 0;
}
But when I submit this program, it says “Time Limit Exceeded”. Clearly the above solution does work fine. And I think that this solution is pretty fast. Is there something wrong with my solution or isn’t there ?
Thanks, Best Regards !