C++ primer plus第六版课后编程练习答案:8.1

#define  _CRT_SECURE_NO_WARNINGS 
#include 
using namespace std;
void print(char* str, int n=0);
int number = 0;

int main()
{

    print("Touch");
    print("touch");
    print("kaziya");
    print("minami");
    print("dajiang", 2);

    return 0;

}

void print(char* str, int n)
{
    number++;
    if (n==0)
        cout << str<else
    {
        for (int i = 0; i < number; i++)
            cout << str << endl;
    }
}

你可能感兴趣的:(C++,primer,plus第六版课后编程练习)