Reputation: 3
Hello I want to know how can I make a code like i want to input a number XXX it will output
ChinaXXX BeijingXXX-CHINA-XXX +180243189(XXX)
Like this. Advance thanks Sorry for the title. I dont how can i said about on title.
Upvotes: 0
Views: 33
Reputation: 13076
Or if you have C++20 available, use std::format
#include <format>
#include <iostream>
#include <string>
int main()
{
std::string number;
std::cin >> number;
std::cout << std::format("China{0} Beijing{0}-CHINA-{0} +180243189({0})\n", number);
return 0;
}
Upvotes: 1
Reputation: 4774
#include <iostream>
#include <string>
int
main()
{
std::string number;
std::cin >> number;
std::cout << "China" << number << " Beijing" << number
<< "-CHINA-" << number << " +180243189(" << number << ")"
<< std::endl;
}
Upvotes: 3