The third job of software introduction

Source: Internet
Author: User

Class did not make the reason: Because a long time did not do programming, write code, some of the Java language has long been forgotten, after a good review of Java.

Programming idea: Using Math.random to randomly generate integers within 100, using character arrays to define subtraction symbols, and to consider dividing two numbers, the denominator is not 0;

and then output it.

Source:

public class Suiji {

public static void Main (String args[])

{int i,j,y,h,g,f; Char x[]={42,43,45,47};

for (h=0;h<30;h++)

{i= (int) (Math.random () *99+0);

y= (int) (Math.random () *x.length+0);

j= (int) (Math.random () *99+1);

g= (int) (Math.random () *99+0);

f= (int) (Math.random () *99+1);

System.out.println ("(" +i+ "/" +j+ ")" +x[y]+ "(" +g+ "/" +f+ ")" + "=");

System.out.println ("(" +i+ x[y]+ g+ ")" + "="); }

}

}

Program:

The third job of software introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.