Professional Documents
Culture Documents
C++ Shell
C++ Shell
sh
online C++ compiler
about cpp.sh
1 #include <iostream>
2 using namespace std;
3 int main()
4 {
5 const int Maxname = 3, Maxwork = 2;
6 string name[Maxname], work[Maxname][Maxwork];
7
8 for (int j = 0; j < Maxname; j++)
9 {
10 cout << "Information of artist #" << j + 1 <<":\n";
11 cout << " Artist Name: ";
12 cin >> name[j];
13
14 for (int d = 0; d < Maxwork; d++)
15 {
16 cout << " Artwork #" << d + 1 << ": ";
17 cin >> work[j][d];
18 }
19 }
20 cout << "------------------------------------\n";
21
22 int numArtist;
23 cout << "Enter the number of the artist you want to search about: ";
24 cin >> numArtist;
25 cpp.sh
cpp.sh
26 for (int j = 0; j < Maxname; j++)
27 {
28 if (j + 1 == numArtist)
29 {
30 cout << "Works of " << name[j] << ":\n";
31 for (int d = 0; d < Maxwork; d++)
32 {
33 cout << " " << "Work #" << d + 1 << " " << work[j][d] << "\n";
34 }
35 }
36 }
37
38 return 0;
39 } ...
C++
C++ shell
shell