楚鸟吧 关注:11贴子:665



通过百度相册上传1楼2013-09-27 01:42回复
    既然都知道for循环了,那你怎么还不会写呢。



    2楼2013-09-27 01:42
    回复



      3楼2013-09-27 01:43
      回复
        用双重循环,外面一层的循环控制三角形的行数,内侧的循环则控制打印字符的个数


        4楼2013-09-27 01:43
        回复

          看不懂


          7楼2013-09-28 13:07
          收起回复
            没有任何人可以击垮你,也没有任何人能够拯救你,人只要拥有信念,有所追求,什么艰苦都能忍受,什么环境都能适应,成功,就是征服自己。人,不怕渺小,只怕卑微,生活是公平的,要活出精彩,需要一颗奋进的心。以勤为本,以韧为基,尽自己的全力,求最好的结果,行动成就梦想,奋斗成就人生。


            8楼2013-09-29 14:05
            回复




              9楼2013-10-02 22:07
              回复
                一个人不懂得自我反省,把一切的原因归结为客观原因和机遇,那他永远不会成长。


                10楼2013-10-09 12:51
                回复
                  深夜怒回复!闭上眼全是数据库。感觉不会再睡了


                  来自Android客户端11楼2013-10-11 02:05
                  收起回复
                    高中的时候之所以最后能那么安静的静下心来学习 是因为相信只要完善自己 想来的 该来的就一定会来 现在的我 怎么可以忘记呢?……继续完善自己 只有自己有了一定的高度 你才能触摸到有高度的世界……你好了 你的世界就好了……(zhuan)


                    12楼2013-10-12 22:21
                    回复


                      通过百度相册上传13楼2013-10-22 23:24
                      回复


                        通过百度相册上传14楼2013-10-22 23:25
                        回复
                          import java.awt.*;
                          import java.awt.event.*;
                          import javax.swing.*;
                          /**
                          *@xiaoluge2012
                          *QQ:1412725135
                          *简单四则运算计算器
                          */
                          public class Calculator extends JFrame{
                          /**
                          * 创建窗口上面的组件
                          */
                          private JButton Num0,Num1,Num2,Num3,Num4,Num5,Num6,Num7,Num8,Num9,Add,Cut,ride,divide,same;//数字按键
                          private JPanel NumPanel,OPpanel;//两个面板
                          private JTextField InputText;//输入框
                          private double number1,number2;//两个输入值
                          private boolean B_same=false;//判断等号是否被按过
                          private int xxx=1;//判断等于之前用的是什么运算符
                          public void luncheFrame(){
                          /**
                          * 主界面
                          */
                          setSize(250,200);
                          setResizable(false);
                          setTitle("简单四则运算");
                          setLocationRelativeTo(null);
                          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                          //处理上面部分
                          InputText=new JTextField();
                          //处理中间部分
                          Num1=new JButton("1");
                          Num2=new JButton("2");
                          Num3=new JButton("3");
                          Num4=new JButton("4");
                          Num5=new JButton("5");
                          Num6=new JButton("6");
                          Num7=new JButton("7");
                          Num8=new JButton("8");
                          Num9=new JButton("9");
                          Add=new JButton("+");
                          Cut=new JButton("-");
                          ride=new JButton("×");
                          divide=new JButton("÷");
                          same=new JButton("=");
                          Num0=new JButton("0");
                          NumPanel=new JPanel(new GridLayout(3,5));
                          NumPanel.add(Num9);
                          NumPanel.add(Num8);
                          NumPanel.add(Num7);
                          NumPanel.add(Add);
                          NumPanel.add(Cut);
                          NumPanel.add(Num6);
                          NumPanel.add(Num5);
                          NumPanel.add(Num4);
                          NumPanel.add(ride);
                          NumPanel.add(divide);
                          NumPanel.add(Num3);
                          NumPanel.add(Num2);
                          NumPanel.add(Num1);
                          NumPanel.add(Num0);
                          NumPanel.add(same);
                          //注册监听
                          Num0.addActionListener(new Mylisten());
                          Num1.addActionListener(new Mylisten());
                          Num2.addActionListener(new Mylisten());
                          Num3.addActionListener(new Mylisten());
                          Num4.addActionListener(new Mylisten());
                          Num5.addActionListener(new Mylisten());
                          Num6.addActionListener(new Mylisten());
                          Num7.addActionListener(new Mylisten());
                          Num8.addActionListener(new Mylisten());
                          Num9.addActionListener(new Mylisten());
                          Add.addActionListener(new Mylisten());
                          Cut.addActionListener(new Mylisten());
                          ride.addActionListener(new Mylisten());
                          divide.addActionListener(new Mylisten());
                          same.addActionListener(new Mylisten());
                          //添加两个面板到主窗口
                          add(InputText,"North");
                          add(NumPanel,"Center");
                          pack();
                          setVisible(true);
                          }
                          /**
                          * 内部类(监听)
                          */
                          private class Mylisten implements ActionListener{
                          public void actionPerformed(ActionEvent e) {
                          if(e.getSource()==Num0){
                          /**
                          * 如果按到"0" 先判断之前是否按过等号,如果按过就清楚输入框里面的数据,达到重新输入计算的效果
                          * 如果没有按过等号 说明正在输入数值,就让原来的数字+"0"达到一直输入数字的效果 下面的数字按键同理
                          */
                          String str=InputText.getText();
                          if(B_same==true){
                          InputText.setText("");
                          B_same=false;
                          InputText.setText("0");
                          }else{
                          InputText.setText(str+"0");
                          }
                          }
                          if(e.getSource()==Num1){
                          String str=InputText.getText();
                          if(B_same==true){
                          InputText.setText("");
                          B_same=false;
                          InputText.setText("1");
                          }else{
                          InputText.setText(str+"1");
                          }
                          }
                          if(e.getSource()==Num2){
                          String str=InputText.getText();
                          if(B_same==true){
                          InputText.setText("");
                          B_same=false;
                          InputText.setText("2");
                          }else{
                          InputText.setText(str+"2");
                          }
                          }
                          if(e.getSource()==Num3){
                          String str=InputText.getText();
                          if(B_same==true){
                          InputText.setText("");
                          B_same=false;
                          InputText.setText("3");
                          }else{
                          InputText.setText(str+"3");
                          }
                          }
                          if(e.getSource()==Num4){
                          String str=InputText.getText();
                          if(B_same==true){
                          InputText.setText("");
                          B_same=false;
                          InputText.setText("4");
                          }else{
                          InputText.setText(str+"4");
                          }
                          }
                          if(e.getSource()==Num5){
                          String str=InputText.getText();
                          if(B_same==true){
                          InputText.setText("");
                          B_same=false;
                          InputText.setText("5");
                          }else{
                          InputText.setText(str+"5");
                          }
                          }
                          if(e.getSource()==Num6){
                          String str=InputText.getText();
                          if(B_same==true){
                          InputText.setText("");
                          B_same=false;
                          InputText.setText("6");
                          }else{
                          InputText.setText(str+"6");
                          }
                          }
                          if(e.getSource()==Num7){
                          String str=InputText.getText();
                          if(B_same==true){
                          InputText.setText("");
                          B_same=false;
                          InputText.setText("7");
                          }else{
                          InputText.setText(str+"7");
                          }
                          }
                          if(e.getSource()==Num8){
                          String str=InputText.getText();
                          if(B_same==true){
                          InputText.setText("");
                          B_same=false;
                          InputText.setText("8");
                          }else{
                          InputText.setText(str+"8");
                          }
                          }
                          if(e.getSource()==Num9){
                          String str=InputText.getText();
                          if(B_same==true){
                          InputText.setText("");
                          B_same=false;
                          InputText.setText("9");
                          }else{
                          InputText.setText(str+"9");
                          }
                          }
                          if(e.getSource()==Add){
                          /**
                          * 如果按了"×" 就让xxx=1 告诉"="号 要计算乘法
                          * 然后获取输入框里面的字符转换为int 付给number1 其他运算符同理
                          */
                          String str=InputText.getText();
                          number1=Integer.parseInt(str);
                          InputText.setText("");
                          xxx=1;//运算符为+
                          }
                          if(e.getSource()==Cut){
                          String str=InputText.getText();
                          number1=Integer.parseInt(str);
                          InputText.setText("");
                          xxx=2;//运算符为-
                          }
                          if(e.getSource()==ride){
                          String str=InputText.getText();
                          number1=Integer.parseInt(str);
                          InputText.setText("");
                          xxx=3;//运算符为X
                          }
                          if(e.getSource()==divide){
                          String str=InputText.getText();
                          number1=Integer.parseInt(str);
                          InputText.setText("");
                          xxx=4;//运算符为/
                          }
                          if(e.getSource()==same){
                          /**
                          * 如果按了等号 首先获取输入框里面的字符转化为int 然后赋值给number2
                          * 判断之前的运算符xxx这个变量的值 1为+ 2为- 3为× 4为÷
                          * 然后根据之前按的运算符来计算number1+number的值 然后赋值给sum
                          * 把sum转换为String 然后显示到输入框
                          * 最后把B_same这个变量值改为true 意思是告诉数字键 按过等号
                          */
                          String str=InputText.getText();
                          number2=Integer.parseInt(str);
                          double sum;
                          if(xxx==1){
                          sum=number1+number2;
                          }else if(xxx==2){
                          sum=number1-number2;
                          }else if(xxx==3){
                          sum=number1*number2;
                          }else{
                          sum=number1/number2;
                          }
                          String str2=sum+"";
                          InputText.setText(str2);
                          B_same=true;
                          number1=0;
                          number2=0;
                          }
                          }
                          }
                          /**
                          * 主方法
                          */
                          public static void main(String[] args){
                          Calculator cl=new Calculator();
                          cl.luncheFrame();//调用主界面
                          }
                          }


                          15楼2013-10-23 17:19
                          回复
                            打开cmd
                            然后输入 mysqld-skip-grand-tables
                            然后再用 mysql -u root 启动数据库就可以进如mysql了 然后可以在不用知道密码的情况下重置root用户的密码
                            前提是你要先关闭mysql的服务举报


                            16楼2013-10-24 13:28
                            回复
                              就是 以前你提交一个form,对web服务器端发起一个request, web给你一个response,这时候一般你的页面也就刷新了。 所以这样的请求很不友好,同时 很多不需要的资源也会加载进来,浪费网络流量。
                              而引入了ajax之后,注意他的全名Asynchronous JavaScript and XML,异步的js和xml,就说名什么? 说明 可以只和服务器传递一部分 需要传递的信息就可以,减少browser和web server之间的通讯,所以就加快了响应速度。
                              ajax就是像服务器发起一个请求,服务器给他返回需要的东西,之后你通过js解析 ,动态的更改html就可以了。


                              17楼2013-10-24 19:45
                              回复