How to make a Input/Output bot in C++
Hello, this is how to make a input/output bot in C++.
First let's get the basics:
#include <iostream> #include <cmath> using namespace std; int main() { return 0; }
We put to use math.
Now, we have to make a input.
To make a input, we have to make a variable:
The DataTypes:
int: stores an integer.
float: stores a integer.
string: stores some text.
#include <iostream> #include <cmath> using namespace std; int main() { //the variable generation float input1; float input2; return 0; }
We leave the variables undefined to make a input.
Then, we make a input for each variable.
#include <iostream> #include <cmath> using namespace std; int main() { //the variable generation float input1; float input2; //the code generation cin >> input1; cin >> input2; return 0; }
Then, we make the final output:
#include <iostream> #include <cmath> using namespace std; int main() { //the variable generation float input1; float input2; //the code generation cin >> input1; cin >> input2; cout << input1 * input2; return 0; }
I hope this tutorial helped you!
Voters
DynamicSquid
- Why use
cmath
? That's for things likepow()
andsqrt()
- I wouldn't really call this a bot, it's just input output
- This doesn't really matter but it's called declaration instead of generation
CodeLongAndPros
@DynamicSquid Actually, there are code generators:
[int(c) for c in list]
It is not working