-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListExample.cpp
More file actions
43 lines (35 loc) · 953 Bytes
/
ListExample.cpp
File metadata and controls
43 lines (35 loc) · 953 Bytes
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
#include <iostream>
#include <string>
#include <list>
using namespace std;
struct Parfum {
string marka;
string model;
int fiyat;
};
int main() {
list<Parfum> parfumler;
int parfumSayisi;
cout << "Kaç parfüm eklemek istiyorsunuz? ";
cin >> parfumSayisi;
for (int i = 0; i < parfumSayisi; i++) {
Parfum parfum;
cout << "Parfüm " << i+1 << endl;
cout << "Marka: ";
cin >> parfum.marka;
cout << "Model: ";
cin >> parfum.model;
cout << "Fiyat: ";
cin >> parfum.fiyat;
cout << endl;
parfumler.push_back(parfum);
}
cout << "Eklenen parfümler:" << endl;
for (list<Parfum>::iterator it = parfumler.begin(); it != parfumler.end(); ++it) {
cout << "Marka: " << it->marka << endl;
cout << "Model: " << it->model << endl;
cout << "Fiyat: " << it->fiyat << endl;
cout << endl;
}
return 0;
}