导航:首页 > 编程语言 > 编程怎么打五角星

编程怎么打五角星

发布时间:2022-07-25 20:45:33

⑴ 五角星符号怎么打

方法一:用搜狗输入法打出五角星

1、用搜狗输入法或者QQ拼音输入法,只要打五角星就会出现“★”往下找还有这个“☆”。

2、在搜狗输入法或QQ输入法中,把鼠标移到输入法悬浮窗的软键盘符号上,点击鼠标右键,选择特殊符号,选择其中的☆★。

方法二:用智能ABC输入法输入五角星符号的方法

1、输入法V+1,然后往后翻8页就是五角星符号。

此方法也适合网络输入法。

⑵ 用 java 编程语言怎么在控制台打印出五角星

我不知道你说的五角星是什么,不过我想你应该是想输出一种图形吧,我自己编了一个程序你看看吧;
在下面字符串数组中用" "和"*"把你想要的图形放到这个数组中,应该就能输出你想要的图形来了,希望你能用得上,

public class ss{
public static void main(String[] args){
private String [][]ss;

ss={{........},
{........},
{........},
.........
{........}};
for(int i=0;i<ss.length;i++){
for(int j=0;j<ss[i].length;j++){
system.out.print(ss[i][j]);
}
system.out.println();
}
}
}

⑶ 五角星符号怎么打

以word2007软件为例,五角星符号“☆”和“★”输入步骤为:

1、打开word2007软件,在“插入”菜单栏中找到“特殊符号”中的“符号”按钮。

⑷ 用编程打出五角星

c++版本

#include<iostream>
using namespace std;
void main()
{
cout<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<"*"<<endl;
cout<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<"*"<<" "<<"*"<<endl;
cout<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<"*"<<" "<<" "<<" "<<"*"<<endl;
cout<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<"*"<<" "<<" "<<" "<<" "<<" "<<"*"<<endl;
cout<<"*"<<" "<<"*"<<" "<<"*"<<" "<<"*"<<" "<<"*"<<" "<<"*"<<" "<<"*"<<" "<<"*"<<" "<<"*"<<" "<<"*"<<" "<<"*"<<endl;
cout<<" "<<" "<<" "<<" "<<" "<<"*"<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<"*"<<endl;
cout<<" "<<" "<<" "<<" "<<"*"<<" "<<" "<<"*"<<" "<<" "<<" "<<" "<<" "<<"*"<<" "<<" "<<"*"<<endl;
cout<<" "<<" "<<" "<<"*"<<" "<<" "<<" "<<" "<<" "<<" "<<"*"<<" "<<" "<<" "<<" "<<" "<<" "<<"*"<<endl;
cout<<" "<<" "<<"*"<<" "<<" "<<" "<<" "<<" "<<"*"<<" "<<" "<<" "<<" "<<"*"<<" "<<" "<<" "<<" "<<"*"<<endl;
cout<<" "<<"*"<<" "<<" "<<"*"<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<"*"<<" "<<" "<<"*"<<endl;
cout<<"*"<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<"*"<<endl;
}

JAVA版本

import java.awt.*;
import javax.swing.*;

public class WuJiaoXing extends JPanel {

private static final long serialVersionUID = 1L;

private JFrame frame = null;

private int r = 150; // 外顶点外接圆半径

private int[] x = new int[5]; // 5个X外顶点坐标

private int[] y = new int[5]; // 5个Y外顶点坐标

private int[] x_ = new int[5]; // 5个X内顶点坐标

private int[] y_ = new int[5]; // 5个Y内顶点坐标

public WuJiaoXing() {
this.math();
frame = new JFrame("五角星");
frame.getContentPane().add(this);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500,500);
frame.setLocation(200, 200);

frame.setVisible(true);
}

private void math() {
int c = 360 / 5; // 角度
for (int i = 0; i < 5; i++) {
x[i] = (int) (Math.cos(i * c * Math.PI / 30 - Math.PI / 2) * (r) + r);
y[i] = (int) (Math.sin(i * c * Math.PI / 30 - Math.PI / 2) * (r) + r);
}
int r_ = (int) (r * Math.sin(18 * Math.PI / 180) / Math
.sin(126 * Math.PI / 180)); // 内顶点外接圆半径
for (int i = 0; i < 5; i++) {
x_[i] = (int) (Math.cos((i * c + 18) * Math.PI / 30 - Math.PI / 2)
* (r_) + r);
y_[i] = (int) (Math.sin((i * c + 18) * Math.PI / 30 - Math.PI / 2)
* (r_) + r);
}
}

public void paint(Graphics g) {
super.paint(g);
g.setColor(Color.YELLOW);
// g.setBackground(Color.RED);
// 填充
int[] x1 = { x[0], x[2], x_[2] };
int[] y1 = { y[0], y[2], y_[2] };
int[] x2 = { x[1], x[3], x_[3] };
int[] y2 = { y[1], y[3], y_[3] };
int[] x3 = { x[2], x[4], x_[4] };
int[] y3 = { y[2], y[4], y_[4] };
g.fillPolygon(x1, y1, 3);
g.fillPolygon(x2, y2, 3);
g.fillPolygon(x3, y3, 3);

// 描边
// g.setColor(Color.BLACK);
// g.drawLine(x[0], y[0], x[2], y[2]);
// g.drawLine(x[0], y[0], x[3], y[3]);
// g.drawLine(x[1], y[1], x[3], y[3]);
// g.drawLine(x[1], y[1], x[4], y[4]);
// g.drawLine(x[2], y[2], x[4], y[4]);
// g.drawLine(x[2], y[2], x[0], y[0]);

}

public static void main(String[] args) {
new WuJiaoXing();
}
}

⑸ 怎么打出五角星符号

⑹ 五角星符号怎么打出来 五角星符号怎么打

1、打出五角星符号方法就是在聊天栏中连续打出五角星的拼音。

2、在输入法的输入页面中点击左下角的符号按钮。

3、在打开的符号页面中选择特殊符号就可以看到五角星符号。

4、点击五角星符号就可以在输入栏里面打出五角星。

⑺ java中五角星怎么用代码去打

=========以下代码抄的
import java.awt.*;
import javax.swing.*;

public class WuJiaoXing extends JPanel {

private static final long serialVersionUID = 1L;

private JFrame frame = null;

private int r = 150; // 外顶点外接圆半径

private int[] x = new int[5]; // 5个X外顶点坐标

private int[] y = new int[5]; // 5个Y外顶点坐标

private int[] x_ = new int[5]; // 5个X内顶点坐标

private int[] y_ = new int[5]; // 5个Y内顶点坐标

public WuJiaoXing() {
this.math();
frame = new JFrame("五角星");
frame.getContentPane().add(this);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500,500);
frame.setLocation(200, 200);

frame.setVisible(true);
}

private void math() {
int c = 360 / 5; // 角度
for (int i = 0; i < 5; i++) {
x[i] = (int) (Math.cos(i * c * Math.PI / 30 - Math.PI / 2) * (r) + r);
y[i] = (int) (Math.sin(i * c * Math.PI / 30 - Math.PI / 2) * (r) + r);
}
int r_ = (int) (r * Math.sin(18 * Math.PI / 180) / Math
.sin(126 * Math.PI / 180)); // 内顶点外接圆半径
for (int i = 0; i < 5; i++) {
x_[i] = (int) (Math.cos((i * c + 18) * Math.PI / 30 - Math.PI / 2)
* (r_) + r);
y_[i] = (int) (Math.sin((i * c + 18) * Math.PI / 30 - Math.PI / 2)
* (r_) + r);
}
}

public void paint(Graphics g) {
super.paint(g);
g.setColor(Color.YELLOW);
// g.setBackground(Color.RED);
// 填充
int[] x1 = { x[0], x[2], x_[2] };
int[] y1 = { y[0], y[2], y_[2] };
int[] x2 = { x[1], x[3], x_[3] };
int[] y2 = { y[1], y[3], y_[3] };
int[] x3 = { x[2], x[4], x_[4] };
int[] y3 = { y[2], y[4], y_[4] };
g.fillPolygon(x1, y1, 3);
g.fillPolygon(x2, y2, 3);
g.fillPolygon(x3, y3, 3);

// 描边
// g.setColor(Color.BLACK);
// g.drawLine(x[0], y[0], x[2], y[2]);
// g.drawLine(x[0], y[0], x[3], y[3]);
// g.drawLine(x[1], y[1], x[3], y[3]);
// g.drawLine(x[1], y[1], x[4], y[4]);
// g.drawLine(x[2], y[2], x[4], y[4]);
// g.drawLine(x[2], y[2], x[0], y[0]);

}

public static void main(String[] args) {
new WuJiaoXing();
}
}

第二种,用控制台

class Pentagram {
private final char FILL_CHAR; // 填充字符
private final char SPACE_CHAR; // 空档字符
private final int R; // 五角星的外接圆半径
private final float ROTATION; // 五角星逆时针旋转角度
private final int X; // 用于生成画图数组
private final int Y; // 用于生成画图数组

/**
* 构造一个Pentagram对象
*
* @param radius
* 五角星的半径
* @param rotation
* 五角星的逆时针旋转度数
* @param spaceChar
* 画布上空白处填充字符
* @param fillChar
* 画布上线条部分填充字符
*/
public Pentagram(int radius, float rotation, char spaceChar, char fillChar) {
this.R = radius;
this.ROTATION = rotation;
this.FILL_CHAR = fillChar;
this.SPACE_CHAR = spaceChar;
this.X = 2 * R + 1;
this.Y = 2 * R + 1;
}

public char[][] getPentagram() {
char[][] canvas = initCanvas();
Draw draw = new Draw(FILL_CHAR);
// 设五角星的最右边的一个点为 A,逆时针选取点 B~E
// 通过圆的极坐标公式可以得出:
// 得出以下各点的坐标
// A 点坐标(0.951R, 0.309R)
// B 点坐标(0, R)
// C 点坐标(-0.951R, 0.309R)
// D 点坐标(-0.588R, -0.809R)
// E 点坐标(0.588R, -0.809R)

// 画线段CA
draw.drawLine(mcos(162) * R, msin(162) * R, mcos(18) * R, msin(18) * R, canvas);
// 画线段DA
draw.drawLine(mcos(234) * R, msin(234) * R, mcos(18) * R, msin(18) * R, canvas);
// 画线段CE
draw.drawLine(mcos(162) * R, msin(162) * R, mcos(306) * R, msin(306) * R, canvas);
// 画线段DB
draw.drawLine(mcos(234) * R, msin(234) * R, mcos(90) * R, msin(90) * R, canvas);
// 画线段BE
draw.drawLine(mcos(90) * R, msin(90) * R, mcos(306) * R, msin(306) * R, canvas);
return canvas;
}

// 在方形的字符数组中指定两点画线条
// 对图形数组进行初始化,填充空格
private char[][] initCanvas() {
char[][] canvas = new char[Y][X];
for (int i = 0; i < Y; i++) {
for (int j = 0; j < X; j++) {
canvas[i][j] = SPACE_CHAR;
}
}
return canvas;
}

// 根据角度求正弦值,保留两位小数
private double msin(float a) {
return ((int) (Math.sin(Math.toRadians(a + ROTATION)) * 100)) / 100.0;
}

// 根据角度求余弦值,保留两位小数
private double mcos(float a) {
return ((int) (Math.cos(Math.toRadians(a + ROTATION)) * 100)) / 100.0;
}
}
class Draw {

private char fillChar;

public Draw(char fillChar) {
this.fillChar = fillChar;
}

/**
* 根据两个点画线在二维字符数组上画线
*
* @param x1
* @param y1
* @param x2
* @param y2
* @param canvas
*/
public void drawLine(double x1, double y1, double x2, double y2, char[][] canvas) {
int radius = (canvas.length - 1) / 2;
// 从 x 方向进行填充
if (x1 > x2) {
double t = x1;
x1 = x2;
x2 = t;
t = y1;
y1 = y2;
y2 = t;
}

// 获得直线方程的两个系数
double a = (y1 - y2) / (x1 - x2);
double b = y1 - a * x1;

// 根据 x 方向的值求出 y 值,并填充图形
for (int i = (int) Math.round(x1); i <= (int) Math.round(x2); i++) {
// 根据直线方程 y = ax + b,求 y
int y = (int) Math.round(a * i + b);

// 因为 y 和 i 算出来的结果有可能是负数,
// 为了采用数组来表示坐标,做了以下变换
// c[R][R] 即为坐标原点
// c[R][0..R] 为 x 方向的负半轴
// c[R][R+1..2*R] 为 x 方向的正半轴
// c[0..R][R] 为 y 方向的正半轴
// c[R+1..2*R][R] 为 y 方向的负半轴
int yy = radius - y;
int xx = radius + i;

yy = yy < 0 ? 0 : yy;
yy = yy > 2 * radius ? 2 * radius : yy;
xx = xx < 0 ? 0 : xx;
xx = xx > 2 * radius ? 2 * radius : xx;

canvas[yy][xx] = fillChar;
}

// 从 y 方向进行填充,便于减少间距问题产生的字符空档
if (y1 > y2) {
double t = x1;
x1 = x2;
x2 = t;
t = y1;
y1 = y2;
y2 = t;
}

// 根据 y 方向的值求出 x 值,并填充图形
for (int i = (int) Math.round(y1); i <= (int) Math.round(y2); i++) {
// 根据 x = (y - b) / a,求 x
int y = (int) Math.round((i - b) / a);

int yy = radius - i;
int xx = radius + y;

yy = yy < 0 ? 0 : yy;
yy = yy > 2 * radius ? 2 * radius : yy;
xx = xx < 0 ? 0 : xx;
xx = xx > 2 * radius ? 2 * radius : xx;

canvas[yy][xx] = fillChar;
}
}

/**
* 将画完图之后的画布输出到控制台上
*
* @param canvas
*/
public static void printCanvas(char[][] canvas) {
for (int i = 0; i < canvas.length; i++) {
for (int j = 0; j < canvas[i].length; j++) {
System.out.print(canvas[i][j]);
}
System.out.println();
}
}

}

public class Test {
public static void main(String[] args) {
// 画一个半径为10,旋转为0,空白为全身空格,填充为★的五角星
Pentagram pen = new Pentagram(10, 0, ' ', '★');
// 在控制台上输出这个五角星
Draw.printCanvas(pen.getPentagram());
}
}
注:其中Pentagram pen = new Pentagram(10, 0, ' ', '★');
10是半径,0是旋转度,' '是以空格表示空格,★是打印的字符。可以自己改

⑻ 五角星符号怎么打出来

工具:笔记本电脑

输入法:搜狗输入法

1、将电脑的输入法置于中文输入状态,如下图所示:

⑼ 编程求一笔画五角星问题

1、如图的五角星。从A点出发,不重复任何路径,也不漏去任何路径,走完一同回
到A(即一笔画)。试编程打印出所有可行方案。
2、如图所示的一个七巧板,现利用四种不同的颜色对每一块进行涂色,
要求相邻
区域的颜色不能相同。试编程找出所有可能的涂色方案。
3、以下列方式向5×5矩阵中填入数字。若该数字i(1≤i≤25)已被置于坐标位
置(x,y),则数字i+1的坐标位置应为(z,w)。(z,w)可按下列关系由(x,
y)算出:
┌┬┬┬┬┐
(1):(z,w)=(x±3,y)
├┼┼┼┼┤
(2):(z,w)=(x,y±3)
├┼┼┼┼┤
(3):(z,w)=(x±2,y±2)
├┼┼┼┼┤
求解问题如下:
├┼┼┼┼┤
└┴┴┴┴┘
(1)编写一个程序,当数字1被指定于某个位置时,列举出其它24个数字应放
在的位置,列举出该条件下所有可能方案,输出方式如图所示。
(2)使数字1的起始位置坐标分别处于矩阵的含主对线的右上三角的每一个位
置,计算出每一种情况下所有可能的方案?
举例:如数字1的起始位置坐标被定为(2,2)则数字2的可能位置坐标应为
(2,5),(5,2)或(4,4)上述位置在图中用“*”号表示。

⑽ 用C语言怎么打印五角星

1、获得五个外顶点的坐标:

intm_xw[5];//5个X外顶点坐标
intm_yw[5];//5个Y外顶点坐标
voidCMyTestView::getCoord()
{
intc=360/5;//角度
intr=150;
for(inti=0;i<5;i++)
{
m_xw[i]=(int)(cos(i*c*PI/30-PI/2)*(r)+r);
m_yw[i]=(int)(sin(i*c*PI/30-PI/2)*(r)+r);
}
}


2、画线段:
在构造函数中调用求顶点坐标的函数求顶点坐标:
this->getCoord();
然后直接在绘图函数中添加如下代码:

voidCMyTestView::OnDraw(CDC*pDC)
{
CMyTestDoc*pDoc=GetDocument();
ASSERT_VALID(pDoc);
//TODO:adddrawcodefornativedatahere
pDC->MoveTo(m_xw[4],m_yw[4]);
pDC->LineTo(m_xw[1],m_yw[1]);
pDC->LineTo(m_xw[3],m_yw[3]);
pDC->LineTo(m_xw[0],m_yw[0]);
pDC->LineTo(m_xw[2],m_yw[2]);
pDC->LineTo(m_xw[4],m_yw[4]);
}
阅读全文

与编程怎么打五角星相关的资料

热点内容
超易学的python 浏览:159
控制面板命令行 浏览:51
为什么空气难压缩是因为斥力吗 浏览:643
郭天祥单片机实验板 浏览:601
服务器有什么危害 浏览:258
饥荒怎么开新的独立服务器 浏览:753
文件夹变成了 浏览:560
linuxpython绿色版 浏览:431
怎么下载小爱同学音箱app 浏览:554
python占位符作用 浏览:76
javajdbcpdf 浏览:543
php网页模板下载 浏览:192
python试讲课pygame 浏览:409
安居客的文件夹名称 浏览:677
家里服务器如何玩 浏览:451
网站源码使用视频 浏览:748
stc89c52单片机最小系统 浏览:452
邮件安全证书加密 浏览:416
云服务器如何访问百度 浏览:279
常州电信服务器dns地址 浏览:839