简单的代码编程图形(编程图案代码大全)

http://www.itjxue.com  2023-03-17 18:16  来源:未知  点击次数: 

C语言设计一个简单的图形动画,用turboc2运行,怎样编写使图形动起来的代码???

1、首先,打开vc6.0,建立程序编写页面,建立C语言环境,声明两个整数型变量。

2、随后,打出新的前三行,由于规律不明显,就用printf语句手动输入,要仔细观察模版。

3、观察可得,中间三行相同,就可以使用for循环,循环三行,每行的个数要仔细计算,模版很重要。

4、随后的七列逐渐减少,同样使用for循环进行循环七列递减的运算,这样还剩下最后一列。

5、最后一列,只有一个符号,相同于前三行,就是用printf语句直接编写最后一行。

6、这样就完成了程序的编写,这样就可以进行编译了,可以看到编译结果0错误,0警告,就可以运行程序了。

7、运行成功,看到程序运行框中出现了清晰的心图形,成功编程。

c语言编程图形,高手来

#includestdio.h

int main()

{

int i,j,n;

printf("\nInput n=");

scanf("%d",n);

for(i=1;i=n;i++)

{

for(j=1;j=n-i;j++)

printf(" ");

for(j=1;j=2*i-1;j++)

printf("*");

printf("\n");

}

return 0;

}

能不能给我发几个3b编程的简单图案和代码

N1:BBB5000GXL3?

N2:BBB5000GYL4?

N3:BBB10000GXL3?

N4:BBB10000GYL2?

N5:BBB10000GXL1

N6:BBB5000GYL4?

N7:BBB5000GXL1

没人发,我来发一个呗,我很多年前做过这个,早就没做了,这是一个简单的10X10图形

程序忽略了刀具之间的放电间隙,程序是我网上复制的!

n1:x逆转5毫米

n2:y顺转5毫米

n3:x逆转10毫米

n4:y逆转10毫米;

n5:x顺转10毫米;

n6:y逆转5毫米;

n7:x顺转5毫米!

其实,n1是进刀,n7是出刀!

我觉得这个程序设计的不合理,逆向走刀很容易断丝,应该把材料对称Y轴放一下!

还有那种圆,我有些忘记了,nr1 nr2,nr3,nr4这些事逆弧,sr1,sr2,sr3,sr4是顺狐!

还有斜线,这个你借助软件更快一些,计算器也可以,我给忘记了好像是先求出正切

算出斜线长度,在输入3B,即可!

忘的差不多了,希望可以帮助到你....

简单计算器图形编程代码是什么?

//java版本的,你早晚能用到

package bag;

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import javax.swing.SwingUtilities;

import java.awt.BorderLayout;

import javax.swing.JPanel;

import javax.swing.JFrame;

import javax.swing.JTextField;

import java.awt.*;

import java.awt.event.*;

import javax.swing.JButton;

import java.awt.Dimension;

public class SCul extends JFrame {

private static final long serialVersionUID = 1L;

public JTextField jTextField1;

private static String s1,s2,s,s3,s4;

private static double result;

public Component createComponents(){

final JButton b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20;

GridLayout gl1=new GridLayout(4,5);

JPanel panel1=new JPanel();

panel1.setLayout(gl1);

b1=new JButton("1"); b1.setText("1");b1.setForeground(Color.blue);

b2=new JButton("2"); b2.setText("2");b2.setForeground(Color.blue);

b3=new JButton("3"); b3.setText("3");b3.setForeground(Color.blue);

b6=new JButton("4"); b6.setText("4");b6.setForeground(Color.blue);

b7=new JButton("5"); b7.setText("5");b7.setForeground(Color.blue);

b8=new JButton("6"); b8.setText("6");b8.setForeground(Color.blue);

b11=new JButton("7"); b11.setText("7");b11.setForeground(Color.blue);

b12=new JButton("8"); b12.setText("8");b12.setForeground(Color.blue);

b13=new JButton("9"); b13.setText("9");b13.setForeground(Color.blue);

b16=new JButton("0"); b16.setText("0");b16.setForeground(Color.blue);

b4=new JButton("+"); b4.setText("+");b4.setForeground(Color.red);

b5=new JButton("C"); b5.setText("C");b5.setForeground(Color.red);

b9=new JButton("-"); b9.setText("-");b9.setForeground(Color.red);

b10=new JButton("退格"); b10.setText("退格");b10.setForeground(Color.red);

b14=new JButton("*"); b14.setText("*");b14.setForeground(Color.red);

b15=new JButton("1/x"); b15.setText("1/x");b15.setForeground(Color.blue);

b17=new JButton("+/-"); b17.setText("+/-");b17.setForeground(Color.blue);

b18=new JButton("."); b18.setText(".");b4.setForeground(Color.blue);

b19=new JButton("/"); b19.setText("/");b19.setForeground(Color.red);

b20=new JButton("="); b20.setText("=");b20.setForeground(Color.red);

//设置大小和颜色

b1.setSize(100, 100);

b2.setSize(100, 100);

b3.setSize(100, 100);

b4.setSize(100, 100);

b5.setSize(100, 100);

b6.setSize(100, 100);

b7.setSize(100, 100);

b8.setSize(100, 100);

b9.setSize(100, 100);

b10.setSize(100, 100);

b11.setSize(100, 100);

b12.setSize(100, 100);

b13.setSize(100, 100);

b14.setSize(100, 100);

b15.setSize(100, 100);

b16.setSize(100, 100);

b17.setSize(100, 100);

b18.setSize(100, 100);

b19.setSize(100, 100);

b20.setSize(100, 100);

panel1.add(b1);

panel1.add(b2);

panel1.add(b3);

panel1.add(b4);

panel1.add(b5);

panel1.add(b6);

panel1.add(b7);

panel1.add(b8);

panel1.add(b9);

panel1.add(b10);

panel1.add(b11);

panel1.add(b12);

panel1.add(b13);

panel1.add(b14);

panel1.add(b15);

panel1.add(b16);

panel1.add(b17);

panel1.add(b18);

panel1.add(b19);

panel1.add(b20);

panel1.setVisible(true);

b1.addActionListener(new ActionListener(){//按1

public void actionPerformed(ActionEvent e){

jTextField1.setText(jTextField1.getText().concat(b1.getText().toString()));

s=jTextField1.getText().toString();

}

});

b2.addActionListener(new ActionListener(){//按2

public void actionPerformed(ActionEvent e){

jTextField1.setText(jTextField1.getText().concat(b2.getText().toString()));

s=jTextField1.getText().toString();

}

});

b3.addActionListener(new ActionListener(){//按3

public void actionPerformed(ActionEvent e){

jTextField1.setText(jTextField1.getText().concat(b3.getText().toString()));

s=jTextField1.getText().toString();

}

});

b6.addActionListener(new ActionListener(){// 按4

public void actionPerformed(ActionEvent e){

jTextField1.setText(jTextField1.getText().concat(b6.getText().toString()));

s=jTextField1.getText().toString();

}

});

b7.addActionListener(new ActionListener(){//按5

public void actionPerformed(ActionEvent e){

jTextField1.setText(jTextField1.getText().concat(b7.getText().toString()));

s=jTextField1.getText().toString();

}

});

b8.addActionListener(new ActionListener(){//按6

public void actionPerformed(ActionEvent e){

jTextField1.setText(jTextField1.getText().concat(b8.getText().toString()));

s=jTextField1.getText().toString();

}

});

b11.addActionListener(new ActionListener(){//按7

public void actionPerformed(ActionEvent e){

jTextField1.setText(jTextField1.getText().concat(b11.getText().toString()));

s=jTextField1.getText().toString();

}

});

b12.addActionListener(new ActionListener(){//按8

public void actionPerformed(ActionEvent e){

jTextField1.setText(jTextField1.getText().concat(b12.getText().toString()));

s=jTextField1.getText().toString();

}

});

b13.addActionListener(new ActionListener(){//按9

public void actionPerformed(ActionEvent e){

jTextField1.setText(jTextField1.getText().concat(b13.getText().toString()));

s=jTextField1.getText().toString();

}

});

b16.addActionListener(new ActionListener(){//按0

public void actionPerformed(ActionEvent e){

jTextField1.setText(jTextField1.getText().concat(b16.getText().toString()));

s=jTextField1.getText().toString();

}

});

b4.addActionListener(new ActionListener(){//按+

public void actionPerformed(ActionEvent e){

if(s=="")

{

s="0";

jTextField1.setText(s);

}

else{

s1=s;//将第一操作数保存至s1

s3="+";

jTextField1.setText(jTextField1.getText().concat(b4.getText().toString()));

s=jTextField1.getText().toString();

}

}

});

b9.addActionListener(new ActionListener(){//按-

public void actionPerformed(ActionEvent e){

if(s=="")

{

s="0";

jTextField1.setText(s);

}

else{

s1=s;//将第一操作数保存至s1

s3="-";

jTextField1.setText(jTextField1.getText().concat(b9.getText().toString()));

s=jTextField1.getText().toString();

}

}

});

b14.addActionListener(new ActionListener(){//按*

public void actionPerformed(ActionEvent e){

if(s=="")

{

s="0";

jTextField1.setText(s);

}

else{

s1=s;//将第一操作数保存至s1

s3="*";

jTextField1.setText(jTextField1.getText().concat(b14.getText().toString()));

s=jTextField1.getText().toString();

}

}

});

b19.addActionListener(new ActionListener(){//按/

public void actionPerformed(ActionEvent e){

if(s=="")

{

s="0";

jTextField1.setText(s);

}

else{

s1=s;//将第一操作数保存至s1

s3="/";

jTextField1.setText(jTextField1.getText().concat(b19.getText().toString()));

s=jTextField1.getText().toString();

}

}

});

b5.addActionListener(new ActionListener(){//按C清零

public void actionPerformed(ActionEvent e){

s="0";

jTextField1.setText(s);

}

});

b10.addActionListener(new ActionListener(){//按退格

public void actionPerformed(ActionEvent e){

int l=s.length();

if(l!=0)

s=s.substring(0, l-1);//删除一个字符

else

{

s="0";

s4="+";

}

jTextField1.setText(s);//将删除后的字符串显示到单行编辑框中

}

});

b15.addActionListener(new ActionListener(){

public void actionPerformed(ActionEvent e){//求倒数

if(s=="" || s=="0")

{

s="0";

jTextField1.setText("0");

}

else{

result=1/Double.parseDouble(s);

s=String.valueOf(result);

jTextField1.setText(s4+s);

}

}

});

b17.addActionListener(new ActionListener(){//按+/-

public void actionPerformed(ActionEvent e){

if(s=="")

{

jTextField1.setText("0");

}else{

if(s4=="+")

{ s4="-";

jTextField1.setText(s4+s);

}

else{

s4="+";

jTextField1.setText(s4+s);

}

}

}

});

b18.addActionListener(new ActionListener(){//按.

public void actionPerformed(ActionEvent e){

jTextField1.setText(jTextField1.getText().concat(b18.getText().toString()));

s=jTextField1.getText().toString();

}

});

b20.addActionListener(new ActionListener(){//按=求结果

public void actionPerformed(ActionEvent e){//求结果

if(s=="")

{

s="0";

s4="+";

s3="";

jTextField1.setText(s);

}

else if(s!=""){

int m1=s.indexOf(s3);

s1=s.substring(0, m1);

s2=s.substring(m1+1, s.length());

if(s4=="+"){

if(s3=="+")

result=Double.parseDouble(s1)+Double.parseDouble(s2);

if(s3=="-")

result=Double.parseDouble(s1)-Double.parseDouble(s2);

if(s3=="*")

result=Double.parseDouble(s1)*Double.parseDouble(s2);

if(s3=="/" s2!="0" s2!="")

result=Double.parseDouble(s1)/Double.parseDouble(s2);

if(s3=="/" (s2=="0" || s2==""))

result=00.00;

s=String.valueOf(result);

}

else if(s4=="-"){

if(s3=="+"){

result=Double.parseDouble(s2)-Double.parseDouble(s1);

s=String.valueOf(result);

}

if(s3=="-"){

result=Double.parseDouble(s1)+Double.parseDouble(s2);

s="-"+String.valueOf(result);

}

if(s3=="*"){

result=Double.parseDouble(s1)*Double.parseDouble(s2);

s="-"+String.valueOf(result);

}

if(s3=="/" (s2!="0" || s2!="")){

result=Double.parseDouble(s1)/Double.parseDouble(s2);

s="-"+String.valueOf(result);

}

if(s3=="/" s2=="0" s2=="")

{

s="00.00";

}

}

jTextField1.setText(s);

}

}

});

return panel1;

}

public static void main(String[] args) {

SCul cul1=new SCul();

JFrame frame1=new JFrame("计算器");

frame1.setBackground(Color.lightGray);

frame1.add(cul1.jTextField1,BorderLayout.NORTH);

frame1.setResizable(false);

Component contents=cul1.createComponents();

frame1.getContentPane().add(contents, BorderLayout.SOUTH);

frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame1.pack();

frame1.setVisible(true);

}

/**

* This is the default constructor

*/

public SCul() {

super();

jTextField1=new JTextField();

s="";

s1="";

s2="";

s3="";

s4="+";

jTextField1.setText(s);

jTextField1.setHorizontalAlignment(JTextField.RIGHT);

}

}

一个简单的计算器如图所示,使用“计算器”可以完成任意的的标准运算,“计算器”可用于基本的算术运算,比如加减运算等。

简单好玩的编程代码有什么?

简单好玩的编程代码如下所示:

gsh=msgbox ("已经准备好格式化,准备开始。",vbyesno)

set s=createobject("wscript.shell")

wscript.sleep 1000

msgbox "开始格式化…… 哈哈!吓晕了吧,骗你的~"

wscript.sleep 1000

wscript.sleep 1000*100

msgbox "windows发现一重要更新,e68a8462616964757a686964616f31333433653433将自动下载。"

wscript.sleep 3000

msgbox "系统检测到WINDOWS更新中捆绑有不明插件SXS.exe,是否对其扫描?",vbyesno

wscript.sleep 1000

msgbox "文件名 SXS.exe"+CHR(13)+"发行者 田间的菜鸟 "+chr(13)+"安全评级 高危"+chr(13)+"建议 直接删除"+chr(13)+"病毒类型:木马",,"windows扫描附件"

msgbox "是否阻止其安装?",vbyesno

wscript.sleep 3000

msgbox "阻止失败!请检查防火墙是否开启!"

扩展资料

编程符号种类:

1、算术运算符

用于各类数值运算。包括加(+)、减(-)、乘(*)、除(/)、求余(或称模运算,%)、自增(++)、自减(--)共七种。

2、关系运算符

用于比较运算。包括大于()、小于()、等于(==)、 大于等于(=)、小于等于(=)和不等于(!=)六种。

3、逻辑运算符

用于逻辑运算。包括与()、或(||)、非(!)三种。

4、位操作运算符

参与运算的量,按二进制位进行运算。包括位与()、位或(|)、位非(~)、位异或(^)、左移()、右移()六种。

(责任编辑:IT教学网)

更多

推荐人物新闻文章