Happy About the progress
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// long
|
||||
|
||||
#include <cs50.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
long dollars = 1;
|
||||
while (true)
|
||||
{
|
||||
char c = get_char("Here's $%li. Double it and give to next person? ", dollars);
|
||||
if (c == 'y')
|
||||
{
|
||||
dollars *= 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
printf("Here's $%li.\n", dollars);
|
||||
}
|
||||
Reference in New Issue
Block a user