![](/static/djangobb_forum/img/smilies/smile.png)
Условие:
![](http://upload.akusherstvo.ru/thumbs/743776.jpg)
Решение на С++
#include<iostream>
class Mail{
private:
std::string box, server;
public:
Mail(std::string s){
SetMail(s);
}
void SetMail(std::string s){
std::string::size_type ind=s.find('@');
box.assign(&s, &s);
server.assign(&s, &s);
}
std::string GetMail()const{
return box+“@”+server;
}
void SetBox(std::string s){
box=s;
}
void SetServer(std::string s){
server=s;
}
};
int main(){
Mail a(“mybox@mail.ru”);
std::cout<<a.GetMail()<<“\n”;
a.SetBox(“myotherbox”);
std::cout<<a.GetMail()<<“\n”;
a.SetServer(“yandex.ru”);
std::cout<<a.GetMail()<<“\n”;
}