Created
September 25, 2022 15:53
-
-
Save Tricky1975/0ccf810b804422571b3d08e5d0187f5b to your computer and use it in GitHub Desktop.
A nice mathematical thing worked out.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
typedef unsigned long long ui; | |
int main() { | |
char t[20]; | |
for(ui i=1;i<=9;++i){ | |
for(char j=0;j<i;++j) {t[j]=(char)49+j; t[i+1]=0;} | |
ui cijfer1{stoi(t)}; | |
cout << cijfer1 << " x 8 + " << i << " = "; | |
cout << cijfer1 * 8 + i; | |
cout << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When this picture was posted by a Twitter friend of mine I simply had to try this out. And see here the result.
(Below a 'playground' screenshot).