| |

VerySource

 Forgot password?
 Register
Search
View: 753|Reply: 4

Set an integer to implement simple operations on integers

[Copy link]

3

Threads

11

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-1-23 16:20:02
| Show all posts |Read mode
Written in verstor in C ++! Please do me a favor! Little sister is here to thank everyone
Reply

Use magic Report

0

Threads

19

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-2-8 05:30:01
| Show all posts
The landlord first gives an example to explain the problem.
Reply

Use magic Report

3

Threads

11

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-3-9 19:30:02
| Show all posts
I just don't know how to write it! Before asking everyone
Reply

Use magic Report

3

Threads

11

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-3-9 23:15:01
| Show all posts
class IntSet
{
private:
    vector <int> Ints;
int element [100];
int n, seeknumber;
public:
IntSet ()
{
cout << "Enter the following integer:";
cin >> n;
for (long i = 0; i <n; i ++)
{
cin >> element [i];
Ints.push_back (element [i]);
};
cout << endl << Ints [0];
};
Empty () {Ints.clear ();};
Isempty () {if (Ints.empty ()) cout << "The collection is empty!" << endl;};
bool Ismemberof ()
{
cout << "To determine if this number is inside the collection, please enter this number:";
cin >> seeknumber;
for (long j = 0; j <n; j ++)
Ranch
if (Ints [j] == seeknumber) return true;
Ranch
};
Add () {};
Sub () {};
Isequal () {};
Intersection () {};
Merge () {};
Print () {};
};
Reply

Use magic Report

3

Threads

11

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-3-10 15:30:01
| Show all posts
This is the procedure. What do you think should be added to the original foundation?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list