// Define a size of... In the main method 10*10 Two dimensional character array based on , Array name y, On the positive and negative diagonals are ‘*’, rest The location is ‘#’; Output all the elements in this array .
char [][]y=new char [10][10];
for(int i=0;i<10;i++)
{
for(int j=0;j<10;j++)
{
if(i==j||i+j==9)
{
y[i][j]='*';
}
else
{
y[i][j]='#';
}
}
}
for(int i =0;i<10;i++)
{
for(int k =0;k<10;k++)
{
System.out.print(y[i][k]+"\t");
}
System.out.println(" ");
}

Define a size of... In the main method 10*10 Two dimensional character array based on , Array name y, On the positive and negative diagonals are ‘*’, rest The location is ‘#’; Output all the elements in this array . More articles about

  1. Define a size of... In the main method 50 One dimensional integer array of , Array i be known as x, The array holds {1,3,5,…,99} Output all the elements in this array , Change one line for every ten output

    package hanqi; import java.util.Scanner; public class Test7 { public static void main(String[] args) ...

  2. 16. Write as required Java Applications . Write a project called Test Main class of , There is only one main method in the class ; Define a size of... In the main method 50 One dimensional integer array of , Array name x, The array holds {1, 3,5,…,99} Output all the elements in this array , Change one line for every ten output ; Define a... In the main method Size is 10*10 Two dimensional character array based on , Array name y, On the positive and negative diagonals are ‘*’, rest The location is ‘#’; Output all the elements in this array .

    // classification package com.bao; public class Shuchu { int[]yi=new int[50]; String[][]er=new String[10][10]; vo ...

  3. Write as required Java Applications . Write a project called Test Main class of , There is only one main method in the class ; Define a size of... In the main method 50 One dimensional integer array of , Array name x, The array holds {1, 3,5,…,99} Output all the elements in this array , Change one line for every ten output ; Define a... In the main method Size is 10*10 Two dimensional character array based on , Array name y, On the positive and negative diagonals are ‘*’, rest The location is ‘#’; Output all the elements in this array .

    int[]x=new int [50]; char[][]y=new char[10][10]; int j=1,w=0; for(int i=0;i<50;i++) { x[i]=j; j+= ...

  4. Write a project called Test Main class of , There is only one main method in the class ; Define a size of... In the main method 50 One dimensional integer array of , Array name x, The array holds {1, 3,5,…,99} Output all the elements in this array , Change one line for every ten output ; Define a... In the main method Size is 10*10 Two dimensional character array based on , Array name y, On the positive and negative diagonals are ‘*’, rest The location is ‘#’; Output all the elements in this array .

    package liu0915; import java.util.Random; public class Test0915sz { public static void main(String[] ...

  5. C# How to define a variable length one-dimensional and two-dimensional array

    1. Suppose that the length of the array to be defined is calculated during the execution of the program MAX List<int> Arc = new List<int>(); ; i < MAX; i++) { Arc. ...

  6. Let's say a size is 100 An array of billions of data , The array is ordered from small to large , Now the array is divided into segments , The data length of each segment is less than 20「 in other words : The title does not say that each piece of data is size identical , It's just about each paragraph size &lt; 20 nothing more 」

    Let's say a size is 100 An array of billions of data , The array is ordered from small to large , Now the array is divided into segments , The data length of each segment is less than 20「 in other words : The title does not say that each piece of data is size identical , It's just about each paragraph size < 20 ...

  7. One size is N Array of , Inside is N It's an integer , How to get rid of repeated numbers

    subject : One size is N Array of , Inside is N It's an integer , How to remove duplicate numbers : The required time complexity is O(n), The space complexity is O(1). Need to get rid of the array of duplicate integers , Notice that I'm not dealing with negative numbers here , In fact, in the case of negative numbers, just use 0 Just sort it out ...

  8. C use malloc Apply to the system for a size of n*4 A block of memory in bytes

    #include <stdio.h> #include <malloc.h> void out(int *p, int n){ int i; for(i=0;i<n;i+ ...

  9. Two dimensional character arrays use gets() Function input

    give an example : ][]; ;i<;i++) gets(a[i]); a Is the array name of a two-dimensional character array , A pointer to a one-dimensional array , therefore a[i] It's like pointing to the second i A pointer to an array , Type is equivalent to char *, Equivalent to a string .

Random recommendation

  1. Mac You don't have permission to start tomcat Solutions for

    Problem description stay Mac Pass through ./startup.sh Execute startup script file , start-up tomcat Times the following mistakes : -bash: ./startup.sh: Permission denied resolvent The error message says ...

  2. EF-InvalidOperation series

    1.InvalidOperation Cast to value type 'System.Guid' Failure , Because the instantiated value is null. The generic parameter or query of the result type must be used, which can be null The type of error message : The cas ...

  3. 【BZOJ】2719 Galactic star

    The pieces can be divided into 9 Types . And two pieces of different kinds can be converted into another kind by merging ( But pay attention to the size of the chessboard , Sometimes, if you insist on merging, you will go outside the chessboard , You can convert all the chessboards first , Then enumerate the transformation of each piece ). Then press the state into a ten digit ...

  4. Objective-c The concept of copying objects

  5. Oracle Flashback operation

    Oracle Flashback operation 1.  Record the current time or SCN Record time or... Before database changes SCN SQL> select  to_char(sysdate,'YYYY-MM-DD HH24:mi:ss') fr ...

  6. ACdream Original group competition (18)のAK&#39;s dream Answer key

    Only do the 4 Water topic ADGI A What we need to pay attention to is “[...]” Output. , When to output , When not to output . #include <stdio.h> int main() { int n, cur, d; ; ...

  7. DesignMode State handling of

    Custom control development debugging and DesignMode State handling of Developing Winform When it comes to programming , We often need to make some custom control modules according to our needs , In this way, the system modules can be reused , Or achieve better results and other functions . But in use , ...

  8. Apple system css Style change

    reason : Apple comes with a style that covers The reference article is more detailed , I don't want to write by myself ,copy A copy of ~~~ @ Reference article Just add a sentence to the style and remove it css Get rid of iPhone.iPad The default button style is OK !~ input[type=& ...

  9. openpyxl Use sheet.rows or sheet.columns newspaper TypeError: &#39;generator&#39; object is not subscriptable Solution

    Solution : Because of the new version of openpyxl Use rows perhaps columns Returns a generator, so you can use List To solve the problem of error reporting >>> sheet.columns[0] Traceback ...

  10. L2-010. Row of seats ( Union checking set )*

    L2-010. Row of seats Reference blog #include<iostream> #include<math.h> using namespace std; ]; ][]; int fi ...