//c++
#include <iostream>
using namespace std;
struct MyInfo {
string surname, name;
int month, day;
MyInfo(string s, string n, int m, int d) {
surname = s;
name = n;
month = m;
day = d;
}
void PrintInfo(){
cout << "Фамилия:" << surname << "\nИмя:" << name << "\nМесяц рождения:" << month << "\nДень рождения: " << day << "\nПароль:" << day + month << endl;
};
signed main() {
setlocale(LC_ALL, "Rus");
MyInfo I("Иванов","Иван",10, 15);
I.PrintInfo();
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
//c++
#include <iostream>
using namespace std;
struct MyInfo {
string surname, name;
int month, day;
MyInfo(string s, string n, int m, int d) {
surname = s;
name = n;
month = m;
day = d;
}
void PrintInfo(){
cout << "Фамилия:" << surname << "\nИмя:" << name << "\nМесяц рождения:" << month << "\nДень рождения: " << day << "\nПароль:" << day + month << endl;
}
};
signed main() {
setlocale(LC_ALL, "Rus");
MyInfo I("Иванов","Иван",10, 15);
I.PrintInfo();
return 0;
}