Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ===================
- || functions.cpp ||
- ===================
- #include <iostream>
- #include <string>
- using namespace std;
- void PrintBirthday(const string& name, int birth_year, int age){
- cout << name << " will turn " << age << " in " << age+birth_year << endl;
- if(age % 50 == 0 && age % 10 == 0){
- cout << "Happy great anniversary!" << endl;
- }
- else if(age % 10 == 0){
- cout << "Happy anniversary!" << endl;
- }
- else
- cout << "Happy birthday!" << endl;
- }
- int main(){
- string name;
- int birth_year, age;
- std::cin >> name >> birth_year >> age;
- PrintBirthday(name, birth_year, age);
- }
- ==============
- || main.cpp ||
- ==============
- #empty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement