c++程序—循环嵌套
#include<iostream> using namespace std; #include<string> #include<ctime> int main() { //嵌套循环打印星图 for (int j = 0; j < 10; j++) { for (int i = 0; i < 10; i++) { cout << "* "; } cout << endl; } system("pause"); return 0; }
#include<iostream> using namespace std; #include<string> #include<ctime> int main() { //嵌套循环打印星图 for (int j = 0; j < 10; j++) { for (int i = 0; i < 10; i++) { cout << "* "; } cout << endl; } system("pause"); return 0; }