摘要: 注意观察每一行的空格和行数的关系,以及星号和行数的关系。 int n; int main() { while(cin>>n) { for(int i=0;i<n;i++) { for(int j=0;j<n*2-(i+1)*2;j++) cout<<' '; for(int j=0;j<n+i*2; 阅读全文
posted @ 2021-01-29 23:34 Dazzling! 阅读(73) 评论(0) 推荐(0) 编辑
摘要: \[ f(x) = \begin{cases} 10 & x \le 4 \\ 10 + 2(x-4) & 4 < x \le 8 \\ 18 + 2.4(x-8) & x \ge 8 \end{cases} \] 如果$x \le 4$,那没什么好说的,铁定的$10$元。 如果$4 < x \le 阅读全文
posted @ 2021-01-29 16:35 Dazzling! 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 虽然简单,但还是有一定代表性的,考察用映射查找学生信息。 const int N=1010; struct Stu { string name; string sex; int age; }; map<string,Stu> mp; int n,m; int main() { while(cin>> 阅读全文
posted @ 2021-01-29 11:53 Dazzling! 阅读(111) 评论(0) 推荐(0) 编辑