https://pintia.cn/problem-sets/994805046380707840/problems/994805145370476544
#include<bits/stdc++.h>
using namespace std;
int main(){
double n;
int t;
cin>>n;
char ss;
cin>>ss;
t = (int)n;
n += 1;
n = n/2;
int x = (int)sqrt(n);
for(int i=0; i<x-1; i++){
for(int j=0; j<i; j++)
cout<<" ";
for(int j=0; j<(x-i)*2-1; j++)
cout<<ss;
cout<<endl;
}
for(int i=0; i<x; i++){
for(int j=0; j<x-i-1; j++)
cout<<" ";
for(int j=0; j<(i+1)*2-1; j++)
cout<<ss;
cout<<endl;
}
int more = t-(1+2*x-1)*x+1;
cout<<more<<endl;
return 0;
}
本文深入探讨了使用C++进行图形绘制的算法实现,包括输入处理、图形生成及额外计算部分。通过具体代码示例,详细展示了如何利用C++标准库进行图形的绘制过程,适合对图形算法和C++编程感兴趣的读者。
507

被折叠的 条评论
为什么被折叠?



