?? 2-5-triangle.cpp
字號(hào):
#include<iostream>
int main()
{
std::cout << "Please type in the length you want:";
std::string::size_type cols;
std::cin >> cols;
std::cout << "Please type in the hight you want:";
std::string::size_type rows;
std::cin >> rows;
std::cout << std::endl;
for(int r = 0;r !=rows;r++) {
int c = 0;
while(c != cols) {
if (r == 0 || c == 0 || c == cols - 1 )
std::cout << '*';
else
std::cout << ' ';
c++;
}
cols--;
std::cout << std::endl;
}
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -