一道C++题目

 1 #include <iostream>
 2 using namespace std;
 3 
 4 int main()
 5 {
 6     int length;
 7     cout << "样本输入:"<<endl; 
 8     cin >> length;
 9     cout << "样本输出:"<<endl; 
10     for (int i = 1; i <= length; i++) 
11     {
12         for (int j = 1; j <= length; j++) 
13         {
14              cout << " ("<<i<<","<<j<<") ";
15              if (j == length) 
16              {
17                  cout << "\n";    
18              }
19         }
20     }
21     return 0;
22 }

posted @ 2016-10-25 23:21  苦味如昔  阅读(174)  评论(0编辑  收藏  举报