Skip to content
← Back to Community
How to make a Input/Output bot in C++
Profile icon
YYX999Piano

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
Profile icon
Pcat1
Profile icon
YYX999Piano
Comments
hotnewtop
Profile icon
Shashank-Deep

It is not working

Profile icon
DynamicSquid
  1. Why use cmath? That's for things like pow() and sqrt()
  2. I wouldn't really call this a bot, it's just input output
  3. This doesn't really matter but it's called declaration instead of generation
Profile icon
CodeLongAndPros

@DynamicSquid Actually, there are code generators:

[int(c) for c in list]