Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct Avtomobil {
- string model;
- string make;
- int first_registration;
- int km;
- int damage;
- void print() {
- cout << "Model: " << model << endl;
- cout << "Make: " << make << endl;
- cout << "First registration year: " << first_registration << endl;
- cout << "Passed " << km << " km" << endl;
- if(damage == 0) {
- cout << "The car has not been in a car accident" << endl;
- }
- else {
- cout << "The car has been in a car accident" << endl;
- }
- }
- };
- int main() {
- Avtomobil m;
- m.model = "mercedes";
- m.make = "S class";
- m.first_registration = 2020;
- m.km = 2000;
- m.damage = 0;
- m.print();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement