When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
21 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
Where is your code?
dang it, ima delete this one and create a new one. Sorry, im new here 😦
how to edit?
just send it as a message here do not bother adding it to the thread
screenshot or file of code?
use the implemented discord feature for sharing codes
google it if you don't know how
```c
int main() {}
```
int main() {}
But if it's all in main(), then I am guessing that it will be one very, very long and complex main().
There is a limit to how long any one post may be, so you will find it difficult to chunk it up here.
Suggest you paste the code into godbolt.org and share a link to it here.
But do try it here first.
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
const int size = 7; // Table size
const int width = 4; // Width of each cell
for(int i=1;i<=12;i++){
cout<<i<<endl;
// Print column headers
cout << setw(width) << " ";
for (int col = 1; col <= size; ++col) {
cout << "|" << setw(width) << col;
}
cout << endl;
// Print line separator
cout << setw(width) << " ";
for (int col = 1; col <= size; ++col) {
cout << "+" << setw(width) << setfill('-') << "----";
}
cout << setfill(' ') << endl;
// Print table rows
for (int row = 1; row <= size; ++row) {
// Print row header
cout << setw(width) << row;
// Print row values
for (int col = 1; col <= size; ++col) {
cout << "|" << setw(width) << row * col;
}
cout << endl;
// Print line separator
if (row != size) {
cout << setw(width) << " ";
for (int col = 1; col <= size; ++col) {
cout << "+" << setw(width) << setfill('-') << "----";
}
cout << setfill(' ') << endl;
}
}
cout<<endl;
}
return 0;
}
it's what the instructor said. other functions would make it easier
Whoah, ehr... that's C++ code.
Didn't clock you mentioned "#include<iostream> and <iomanip>".
This should really be posted in #1013107104678162544
dang it. it's a little to complex for me. ima delete it. im so sorry