Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

C++ shell cpp.

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

Link to this code: [copy] Run


:
execution
Information of artist #1:
Artist Name: Fernando_Amorsolo
Artwork #1: Planting_Rice
Artwork #2: Dalagang_Bukid
Information of artist #2:
Artist Name: Napoleon_Abueva
Artwork #1: Kiss_of_Judas
Artwork #2: The_Transfiguration
Information of artist #3:
Artist Name: Amado_Hernandez
Artwork #1: Luha_ng_Buwaya
Artwork #2: Mga_Ibong_Mandaragit
------------------------------------
Enter the number of the artist you want to search about: 1
Works of Fernando_Amorsolo:
Work #1 Planting_Rice
Work #2 Dalagang_Bukid

Normal program termination. Exit status: 0

C++ Shell 2.0 © cpp.sh 2014-2024 | buy me a co!e


old version still available here (for a limited time).
:

You might also like