/*1, a game,The first 20-off is the score of each of its own,21-30 off each pass is 10 points,31-40 off, each level is 20 points,41-49 off, each level is 30 points,50 off, is 100 points,Enter the number of levels you've reached now and ask for the score you have now.*/ /*var g=prompt ("Close number") var b = 0; if (g */Print a triangle two for loop nesting*********************************************************//*For (var h = 0;h */ /*For (var h = 0;h */ /*For (var h = 0;h
offset is generally calculated relative to the beginning of the file and is generally a positive number. However, if the whence parameter is provided, whence can be calculated from scratch for 0, and 1 for the current position as its origin. 2 means that the end of the file is calculated as the origin. Note that if the file is opened in a or a + mode, the file action tag is automatically returned to the end of the file each time the write operation is made. Fp.truncate ([size]) #把文件裁成规定的大小, th
{
public static final int NUM = 3;
public static void Main (String args[]) {
try {
Socket socket = new socket ("127.0.0.1", 4700);
BufferedReader sin = new BufferedReader (new InputStreamReader (system.in));
PrintWriter OS = new PrintWriter (Socket.getoutputstream ());
System.out.println ("Three sides from the client receive triangle sent to the server:");
System.out.println ("Please enter 3 sides:");
String ReadLine = "";
For (int i = 0; i
Os.flush ()
14. Use for loop and range output15. Use for loop and range output 9 * 9 multiplication table16, for the prime number within 100 and. (Programming Questions)17. [1,3,2,7,6,23,41,24,33,85,56] from small to large (bubbling method) (programming)Li = [1,3,2,7,6,23,41,24,33,85,56]for i in Range (Len (LI)-1): # I range 0-9 if li[i] > li[i+1]: # Adjacent two number comparison li[i],li[ I+1] = Li[i+1],li[i]print (LI)Li = [1,3,2,7,6,23,41,24,33,85,56]for i in Range (Len (LI)-1): # I's Range 0-9
valueSecond, complete the main methodTips: 1, call the custom method, save the method return value in the variable maxscore 2, output variable result1 Public classHelloWorld {2 3 //complete the Main method4 Public Static voidMain (string[] args) {5 6 //Create object, object named Hello7HelloWorld Hello =NewHelloWorld ();8 9 //calling a method and saving the return value in a variableTen intMaxscore =hello.getmaxage (); One A
Write loop guess age program, guess three times wrong print cue message and exit the loop, guess to also print the message and exit the loop
Count=0 whileCount 3: Num= Input ("guess age Game:") Guess=int(num)ifGuess = = -: Print ("congratulations on your guess.") Elif Guess> -: Print ("big.") Elif Guess -: Print ("it's small.") Count+=1Else: Print ("I guess I didn't guess three times.")
Write a small example of a while loop nesting, using a tag to control the exit of all while loop
# Coding=utf-8import turtle# Draw Pentagram def Drawstar (x): Turtle.begin_fill () for I in range (5): Turtle.forward (x ) Turtle.right (144) Turtle.end_fill () # transfer position def goTo (x, y): turtle.up () Turtle.goto (x, y) Turtle.down () Turtle.setup (864, 576) Turtle.bgcolor ("Red") Turtle.color ("Yellow") Turtle.fillcolor ("Yellow") Turtle.hideturtle () GoTo ( -380, X) Turtle.showturtle () Drawstar () for I in range (4): x = 1 If i in [0, 3]:
;//boolean b2=s1Fourth. Exercise 1: (1) write a program that prints values from 1 to 100public static void Main (string[] args) {test (100);} public static void Test (int num) {int i=0;while (iExercise 2: (2) write a program that generates 25 random numbers of type int, and for each random number, use the If-else statement to classify it as greater than, less than, or equal to a randomly generated value immediately following it.public static void Main (string[] args) {test ();} public static voi
Java.util.hashmap;import java.util.iterator;import Java.util.map;import Java.util.scanner;import Java.util.treemap;import Javax.management.runtimeerrorexception;public class Main {public static void Main (string[] args) {/* The application of Map collection in table-checking method is more */int num; Scanner in = new Scanner (system.in); num = In.nextint (); String week = Get_week (num-1); SYSTEM.OUT.PRINTLN (week); System.out.println (Get_week_english (Week)); In.close ();} public static Strin
This article is based on the 0 basics of Python, the most basic exercise, not including functions and object-oriented.Are I collected on the Internet some of the exercise materials, not much nonsense on the topic1. Use three lines of print to complete the display of the following information: ================================== = 欢迎进入到身份认证系统V1.0 = 1. 登录 = 2. 退出 = 3. 认证 = 4. 修改密码 ==================================代码:Print ("="*50) Print ("=\t Welcome to the authenticati
their definitions into a hash list; The second part lets the user enter a word, and the program gives the definition of the word.// 字典类function Dict () { this.hashTable = new HashTable(); this.save = save; this.find = find;}function save (word, description) { this.hashTable.put(word, description);}function find (word) { return this.hashTable.get(word);}// 示例let d = new Dict();d.save('Mazey', 'a strong man.');d.save('Cherrie', 'a beautiful girl.');d.save('John', 'unknown.');consol
2, randomly generate a number within five bits, and then output the number of bits in total, what each bit is3. Develop a game application titled "Flipflop". It counts from 1 to 100, and a multiple of 3 is replaced with the word "Flip", a multiple of 5 is replaced with the word "Flop", and a multiple of 3 and 5 is replaced with the word "flipflop".5. Generate 13-bit barcodeEAN-13 Code rule: The 13th digit is the computed checksum of the first 12 digits.Example: 690123456789The 13th-digit process
2419:c language exercises and other long string sortingTime limit:1 Sec Memory limit:128 MB
submit:426 solved:169
[Submit] [Status] [Web Board]
Description
Enter an equal-length string of n (nInput
N and N equal-length string Output
n a sorted string, Sample Input ,
5
abcdf
12345
ert45
fg432
erfff
Sample Output
12345
abcdf
erfff
ert45
fg432
AC Code:
#include
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.