SHOW:
|
|
- or go back to the newest paste.
| 1 | using namespace std; | |
| 2 | ||
| 3 | - | struct Pfand{
|
| 3 | + | struct Pfand {
|
| 4 | int Glasflasche; | |
| 5 | int Plastikflasche; | |
| 6 | }; | |
| 7 | - | Pfand wert; |
| 7 | + | |
| 8 | Pfand eingabe() {
| |
| 9 | - | Pfand Eingabe(){
|
| 9 | + | |
| 10 | cin >> wert.Glasflasche; | |
| 11 | - | cin>>wert.Glasflasche; |
| 11 | + | cin >> wert.Plastikflasche; |
| 12 | - | cin>>wert.Plastikflasche; |
| 12 | + | |
| 13 | } | |
| 14 | ||
| 15 | int berechnung(Pfand wert) | |
| 16 | {
| |
| 17 | int ret = wert.Glasflasche * wert.Plastikflasche; | |
| 18 | - | int Wert1; |
| 18 | + | cout << ret; |
| 19 | - | Pfand Eingabe(); |
| 19 | + | return ret; |
| 20 | - | Wert1 = wert.Glasflasche * wert.Plastikflasche; |
| 20 | + | |
| 21 | - | cout<<Wert1; |
| 21 | + | |
| 22 | - | return Wert1; |
| 22 | + | |
| 23 | int main() | |
| 24 | {
| |
| 25 | Pfand pfand = eingabe(); | |
| 26 | int ret = berechnung(pfand); | |
| 27 | cout << "Hello World!" << endl; | |
| 28 | - | Pfand Eingabe(); |
| 28 | + | |
| 29 | - | int berechnung(Pfand wert); |
| 29 | + |