Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Viewed less than a minute ago

Ldq7QIliNm1ikfiW

C++ gcc 12.1.0

Created at 1 minute ago

Created by anonymous

Author

anonymous

1 minute ago

Language

C++

Compiler

gcc 12.1.0

Options
Warnings
Don't Use Boost
C++11
-pedantic
セオライド・テクノロジー㈱株式会社フィックスターズ
Siv3D

Author

anonymous

1 minute ago

›
⌄
⌄
⌄
⌄
⌄
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <iostream>
#include <vector>

using namespace std;

int main(){
bool isrunning {true};
vector <int> nums {10,10,10,10};
while (isrunning){
char choice {};
char throwaway{};
int numtoadd {};
cout<<"P - Print Numbers" << endl;
cout<<"A - Add a Number" << endl;
cout<<"M - display mean of the numbers"<<endl;
cout<<"S - display smallest number"<<endl;
cout<<"L - display largest number"<<endl;
cout<<"Q - Quit"<<endl;
cout<<"Enter your choice:"<<endl;
cin >> choice;
switch (choice)
{
case 'P' :
for(auto num:nums){
cout << num << "\n";
}
break;
case 'p' :
for(auto num:nums){
cout << num << "\n";
}
break;
case 'A':
cout << "Input an integer to add:" << endl;
cin >> numtoadd;
nums.push_back(numtoadd);
cout << numtoadd << " Added." << endl;
break;
case 'a':
cout << "Input an integer to add:" << endl;
cin >> numtoadd;
nums.push_back(numtoadd);
cout << numtoadd << " Added." << endl;
break;
case 'Q':
isrunning = false;
break;
case 'q':
isrunning = false;
break;
default:
cout<<"Illegal Input"<<endl;
break;
}
cout<<"Enter any number to continue."<<endl;
cin >> throwaway;
}
}
›
99
1
2
3
4
5
6
7
8
9
10
11
12
13
A
334
0
a
42
0
P
0
r
0
q
0

$ g++ prog.cc -Wall -Wextra -std=c++11 -pedantic
P - Print Numbers
A - Add a Number
M - display mean of the numbers
S - display smallest number
L - display largest number
Q - Quit
Enter your choice:
Input an integer to add:
334 Added.
Enter any number to continue.
P - Print Numbers
A - Add a Number
M - display mean of the numbers
S - display smallest number
L - display largest number
Q - Quit
Enter your choice:
Input an integer to add:
42 Added.
Enter any number to continue.
P - Print Numbers
A - Add a Number
M - display mean of the numbers
S - display smallest number
L - display largest number
Q - Quit
Enter your choice:
10
10
10
10
334
42
Enter any number to continue.
P - Print Numbers
A - Add a Number
M - display mean of the numbers
S - display smallest number
L - display largest number
Q - Quit
Enter your choice:
Illegal Input
Enter any number to continue.
P - Print Numbers
A - Add a Number
M - display mean of the numbers
S - display smallest number
L - display largest number
Q - Quit
Enter your choice:
Enter any number to continue.
Exit Code:
0
セオライド・テクノロジー㈱株式会社フィックスターズ
Siv3D