fornested.cpp
来自「20学时功课c++ 所有例子」· C++ 代码 · 共 23 行
CPP
23 行
//Listing 6.13
//Illustrates nested for loops
#include <iostream>
int main()
{
int rows, columns;
char theChar;
std::cout << "How many rows? ";
std::cin >> rows;
std::cout << "How many columns? ";
std::cin >> columns;
std::cout << "What character? ";
std::cin >> theChar;
for (int i = 0; i<rows; i++)
{
for (int j = 0; j < columns; j++)
std::cout << theChar;
std::cout << "\n";
}
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?