mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-04-13 09:59:49 +08:00
support bazel complie this project and format code.
This commit is contained in:
24
practical_exercises/10_day_practice/day1/print.cpp
Normal file
24
practical_exercises/10_day_practice/day1/print.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
/* 打印练习.cpp */
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
int main(int argc, char const *argv[]) {
|
||||
int i, j, k, f;
|
||||
for (i = 1; i <= 4; i++) {
|
||||
for (j = 1; j <= 30; j++)
|
||||
cout << " ";
|
||||
for (k = 1; k <= 8 - 2 * i; k++)
|
||||
cout << " ";
|
||||
for (f = 1; f <= 2 * i; f++)
|
||||
cout << '*';
|
||||
cout << endl;
|
||||
}
|
||||
for (i = 1; i <= 3; i++) {
|
||||
for (j = 1; j <= 30; j++)
|
||||
cout << " ";
|
||||
for (f = 1; f <= 7 - 2 * i; f++)
|
||||
cout << '*';
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user